We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a7aca9 commit 306d9e0Copy full SHA for 306d9e0
testing/test_pathlib.py
@@ -37,6 +37,20 @@
37
import pytest
38
39
40
+@pytest.fixture(autouse=True)
41
+def autouse_pytester(pytester: Pytester) -> None:
42
+ """
43
+ Fixture to make pytester() being autouse for all tests in this module.
44
+
45
+ pytester makes sure to restore sys.path to its previous state, and many tests in this module
46
+ import modules and change sys.path because of that, so common module names such as "test" or "test.conftest"
47
+ end up leaking to tests in other modules.
48
49
+ Note: we might consider extracting the sys.path restoration aspect into its own fixture, and apply it
50
+ to the entire test suite always.
51
52
53
54
class TestFNMatcherPort:
55
"""Test our port of py.common.FNMatcher (fnmatch_ex)."""
56
0 commit comments