From 9b8039cf094063a80bd13ce32e3f4b48a77fe89c Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 14 Jan 2020 18:58:02 +0100 Subject: [PATCH] Sync `{Session,Package}._recurse` --- src/_pytest/main.py | 2 +- src/_pytest/python.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 7ce4c19ea..283ff29b1 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -625,7 +625,7 @@ class Session(nodes.FSCollector): 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__": return False ihook = self.gethookproxy(dirpath.dirpath()) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 82dca3bcc..869e45261 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -571,12 +571,12 @@ class Package(Module): func = partial(_call_with_optional_argument, teardown_module, self.obj) self.addfinalizer(func) - def _recurse(self, dirpath): + def _recurse(self, dirpath: py.path.local) -> bool: if dirpath.basename == "__pycache__": return False ihook = self.gethookproxy(dirpath.dirpath()) if ihook.pytest_ignore_collect(path=dirpath, config=self.config): - return + return False for pat in self._norecursepatterns: if dirpath.check(fnmatch=pat): return False