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 c9ce821 commit bf112c3Copy full SHA for bf112c3
testing/test_pathlib.py
@@ -35,6 +35,20 @@
35
import pytest
36
37
38
+@pytest.fixture(autouse=True)
39
+def autouse_pytester(pytester: Pytester) -> None:
40
+ """
41
+ Fixture to make pytester() being autouse for all tests in this module.
42
+
43
+ pytester makes sure to restore sys.path to its previous state, and many tests in this module
44
+ import modules and change sys.path because of that, so common module names such as "test" or "test.conftest"
45
+ end up leaking to tests in other modules.
46
47
+ Note: we might consider extracting the sys.path restoration aspect into its own fixture, and apply it
48
+ to the entire test suite always.
49
50
51
52
class TestFNMatcherPort:
53
"""Test our port of py.common.FNMatcher (fnmatch_ex)."""
54
0 commit comments