@@ -146,10 +146,9 @@ def test_issue151_load_all_conftests(pytester: Pytester) -> None:
146
146
p = pytester .mkdir (name )
147
147
p .joinpath ("conftest.py" ).touch ()
148
148
149
- conftest = PytestPluginManager ()
150
- conftest_setinitial (conftest , names )
151
- d = list (conftest ._conftestpath2mod .values ())
152
- assert len (d ) == len (names )
149
+ pm = PytestPluginManager ()
150
+ conftest_setinitial (pm , names )
151
+ assert len (set (pm .get_plugins ()) - {pm }) == len (names )
153
152
154
153
155
154
def test_conftest_global_import (pytester : Pytester ) -> None :
@@ -192,7 +191,7 @@ def test_conftestcutdir(pytester: Pytester) -> None:
192
191
conf .parent , importmode = "prepend" , rootpath = pytester .path
193
192
)
194
193
assert len (values ) == 0
195
- assert Path ( conf ) not in conftest ._conftestpath2mod
194
+ assert not conftest .has_plugin ( str ( conf ))
196
195
# but we can still import a conftest directly
197
196
conftest ._importconftest (conf , importmode = "prepend" , rootpath = pytester .path )
198
197
values = conftest ._getconftestmodules (
@@ -226,15 +225,15 @@ def test_setinitial_conftest_subdirs(pytester: Pytester, name: str) -> None:
226
225
sub = pytester .mkdir (name )
227
226
subconftest = sub .joinpath ("conftest.py" )
228
227
subconftest .touch ()
229
- conftest = PytestPluginManager ()
230
- conftest_setinitial (conftest , [sub .parent ], confcutdir = pytester .path )
228
+ pm = PytestPluginManager ()
229
+ conftest_setinitial (pm , [sub .parent ], confcutdir = pytester .path )
231
230
key = subconftest .resolve ()
232
231
if name not in ("whatever" , ".dotdir" ):
233
- assert key in conftest . _conftestpath2mod
234
- assert len (conftest . _conftestpath2mod ) == 1
232
+ assert pm . has_plugin ( str ( key ))
233
+ assert len (set ( pm . get_plugins ()) - { pm } ) == 1
235
234
else :
236
- assert key not in conftest . _conftestpath2mod
237
- assert len (conftest . _conftestpath2mod ) == 0
235
+ assert not pm . has_plugin ( str ( key ))
236
+ assert len (set ( pm . get_plugins ()) - { pm } ) == 0
238
237
239
238
240
239
def test_conftest_confcutdir (pytester : Pytester ) -> None :
0 commit comments