Skip to content

Commit 6c4f908

Browse files
committed
fix: reload after tests that modify behaviour
1 parent c6f435a commit 6c4f908

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_unix.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
from pytest_mock import MockerFixture
1919

2020

21+
@pytest.fixture
22+
def _reload_after_test() -> typing.Iterator[None]:
23+
yield
24+
importlib.reload(unix)
25+
26+
2127
@pytest.mark.parametrize(
2228
"prop",
2329
[
@@ -175,7 +181,7 @@ def test_platform_on_win32(monkeypatch: pytest.MonkeyPatch, mocker: MockerFixtur
175181
sys.modules["platformdirs.unix"] = prev_unix
176182

177183

178-
@pytest.mark.usefixtures("_getuid")
184+
@pytest.mark.usefixtures("_getuid", "_reload_after_test")
179185
@pytest.mark.parametrize(
180186
("platform", "default_dir"),
181187
[

0 commit comments

Comments
 (0)