@@ -73,28 +73,28 @@ class FixtureChecker(BasePytestChecker):
73
73
}
74
74
75
75
# Store all fixtures discovered by pytest session
76
- pytest_fixtures : FixtureDict = {}
76
+ _pytest_fixtures : FixtureDict = {}
77
77
# Stores all used function arguments
78
- invoked_with_func_args : set [str ] = set ()
78
+ _invoked_with_func_args : set [str ] = set ()
79
79
# Stores all invoked fixtures through @pytest.mark.usefixture(...)
80
- invoked_with_usefixtures : set [str ] = set ()
80
+ _invoked_with_usefixtures : set [str ] = set ()
81
81
82
82
def close (self ):
83
83
"""restore & reset class attr for testing"""
84
84
# reset fixture info storage
85
- FixtureChecker .pytest_fixtures = {}
86
- FixtureChecker .invoked_with_func_args = set ()
87
- FixtureChecker .invoked_with_usefixtures = set ()
85
+ FixtureChecker ._pytest_fixtures = {}
86
+ FixtureChecker ._invoked_with_func_args = set ()
87
+ FixtureChecker ._invoked_with_usefixtures = set ()
88
88
89
89
def visit_module (self , node ):
90
90
"""
91
91
- only run once per module
92
92
- invoke pytest session to collect available fixtures
93
93
- create containers for the module to store args and fixtures
94
94
"""
95
- FixtureChecker .pytest_fixtures = {}
96
- FixtureChecker .invoked_with_func_args = set ()
97
- FixtureChecker .invoked_with_usefixtures = set ()
95
+ FixtureChecker ._pytest_fixtures = {}
96
+ FixtureChecker ._invoked_with_func_args = set ()
97
+ FixtureChecker ._invoked_with_usefixtures = set ()
98
98
99
99
is_test_module = False
100
100
for pattern in FILE_NAME_PATTERNS :
@@ -128,7 +128,7 @@ def visit_module(self, node):
128
128
# restore sys.path
129
129
sys .path = sys_path
130
130
131
- FixtureChecker .pytest_fixtures = fixture_collector .fixtures
131
+ FixtureChecker ._pytest_fixtures = fixture_collector .fixtures
132
132
133
133
legitimate_failure_paths = set (
134
134
collection_report .nodeid
@@ -212,11 +212,11 @@ def visit_functiondef(self, node):
212
212
if _is_pytest_mark_usefixtures (decorator ):
213
213
# save all visited fixtures
214
214
for arg in decorator .args :
215
- self .invoked_with_usefixtures .add (arg .value )
215
+ self ._invoked_with_usefixtures .add (arg .value )
216
216
if int (pytest .__version__ .split ("." )[0 ]) >= 3 and _is_pytest_fixture (
217
217
decorator , fixture = False
218
218
):
219
219
# raise deprecated warning for @pytest.yield_fixture
220
220
self .add_message ("deprecated-pytest-yield-fixture" , node = node )
221
221
for arg in node .args .args :
222
- self .invoked_with_func_args .add (arg .name )
222
+ self ._invoked_with_func_args .add (arg .name )
0 commit comments