@@ -348,18 +348,6 @@ def pytest_collection_modifyitems(items, config):
348348 items [:] = remaining
349349
350350
351- class FSHookProxy :
352- def __init__ (self , fspath , pm , remove_mods ):
353- self .fspath = fspath
354- self .pm = pm
355- self .remove_mods = remove_mods
356-
357- def __getattr__ (self , name ):
358- x = self .pm .subset_hook_caller (name , remove_plugins = self .remove_mods )
359- self .__dict__ [name ] = x
360- return x
361-
362-
363351class NoMatch (Exception ):
364352 """ raised if matching cannot locate a matching names. """
365353
@@ -401,7 +389,6 @@ def __init__(self, config: Config) -> None:
401389 self .shouldstop = False
402390 self .shouldfail = False
403391 self .trace = config .trace .root .get ("collection" )
404- self ._norecursepatterns = config .getini ("norecursedirs" )
405392 self .startdir = config .invocation_dir
406393 self ._initialpaths = frozenset () # type: FrozenSet[py.path.local]
407394
@@ -450,18 +437,7 @@ def isinitpath(self, path):
450437 return path in self ._initialpaths
451438
452439 def gethookproxy (self , fspath ):
453- # check if we have the common case of running
454- # hooks with all conftest.py files
455- pm = self .config .pluginmanager
456- my_conftestmodules = pm ._getconftestmodules (fspath )
457- remove_mods = pm ._conftest_plugins .difference (my_conftestmodules )
458- if remove_mods :
459- # one or more conftests are not in use at this fspath
460- proxy = FSHookProxy (fspath , pm , remove_mods )
461- else :
462- # all plugins are active for this fspath
463- proxy = self .config .hook
464- return proxy
440+ return super ()._gethookproxy (fspath )
465441
466442 def perform_collect (self , args = None , genitems = True ):
467443 hook = self .config .hook
@@ -625,19 +601,6 @@ def _collectfile(self, path, handle_dupes=True):
625601
626602 return ihook .pytest_collect_file (path = path , parent = self )
627603
628- def _recurse (self , dirpath : py .path .local ) -> bool :
629- if dirpath .basename == "__pycache__" :
630- return False
631- ihook = self .gethookproxy (dirpath .dirpath ())
632- if ihook .pytest_ignore_collect (path = dirpath , config = self .config ):
633- return False
634- for pat in self ._norecursepatterns :
635- if dirpath .check (fnmatch = pat ):
636- return False
637- ihook = self .gethookproxy (dirpath )
638- ihook .pytest_collect_directory (path = dirpath , parent = self )
639- return True
640-
641604 @staticmethod
642605 def _visit_filter (f ):
643606 return f .check (file = 1 )
0 commit comments