Sync `{Session,Package}._recurse`
This commit is contained in:
parent
b687f20d25
commit
9b8039cf09
|
@ -625,7 +625,7 @@ class Session(nodes.FSCollector):
|
||||||
|
|
||||||
return ihook.pytest_collect_file(path=path, parent=self)
|
return ihook.pytest_collect_file(path=path, parent=self)
|
||||||
|
|
||||||
def _recurse(self, dirpath):
|
def _recurse(self, dirpath: py.path.local) -> bool:
|
||||||
if dirpath.basename == "__pycache__":
|
if dirpath.basename == "__pycache__":
|
||||||
return False
|
return False
|
||||||
ihook = self.gethookproxy(dirpath.dirpath())
|
ihook = self.gethookproxy(dirpath.dirpath())
|
||||||
|
|
|
@ -571,12 +571,12 @@ class Package(Module):
|
||||||
func = partial(_call_with_optional_argument, teardown_module, self.obj)
|
func = partial(_call_with_optional_argument, teardown_module, self.obj)
|
||||||
self.addfinalizer(func)
|
self.addfinalizer(func)
|
||||||
|
|
||||||
def _recurse(self, dirpath):
|
def _recurse(self, dirpath: py.path.local) -> bool:
|
||||||
if dirpath.basename == "__pycache__":
|
if dirpath.basename == "__pycache__":
|
||||||
return False
|
return False
|
||||||
ihook = self.gethookproxy(dirpath.dirpath())
|
ihook = self.gethookproxy(dirpath.dirpath())
|
||||||
if ihook.pytest_ignore_collect(path=dirpath, config=self.config):
|
if ihook.pytest_ignore_collect(path=dirpath, config=self.config):
|
||||||
return
|
return False
|
||||||
for pat in self._norecursepatterns:
|
for pat in self._norecursepatterns:
|
||||||
if dirpath.check(fnmatch=pat):
|
if dirpath.check(fnmatch=pat):
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue