Skip to content

Commit

Permalink
Ignore a DeprecationWarning which is breaking the test assertions
Browse files Browse the repository at this point in the history
```
DeprecationWarning: the load_module() method is deprecated and slated for removal in Python 3.12; use exec_module() instead
```

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed Dec 15, 2023
1 parent e45c2eb commit f6e6673
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/pytests/functional/states/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import shutil
import socket
import sys
import warnings
from contextlib import closing

import pytest
Expand Down Expand Up @@ -212,10 +213,12 @@ def test_file_symlink_replace_existing_link(states, tmp_path):
old_target = tmp_path / "bar"
name.symlink_to(old_target)

ret = states.file.symlink(
name=str(name),
target=str(target),
)
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=DeprecationWarning, lineno=283)
ret = states.file.symlink(
name=str(name),
target=str(target),
)

assert ret.filtered == {
"name": str(name),
Expand Down

0 comments on commit f6e6673

Please sign in to comment.