main: couple of code simplifications
This commit is contained in:
parent
023f0510af
commit
c1f975668e
|
@ -511,8 +511,7 @@ class Session(nodes.FSCollector):
|
||||||
if ihook.pytest_ignore_collect(path=path, config=self.config):
|
if ihook.pytest_ignore_collect(path=path, config=self.config):
|
||||||
return False
|
return False
|
||||||
norecursepatterns = self.config.getini("norecursedirs")
|
norecursepatterns = self.config.getini("norecursedirs")
|
||||||
for pat in norecursepatterns:
|
if any(path.check(fnmatch=pat) for pat in norecursepatterns):
|
||||||
if path.check(fnmatch=pat):
|
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -650,8 +649,7 @@ class Session(nodes.FSCollector):
|
||||||
|
|
||||||
if parent.isdir():
|
if parent.isdir():
|
||||||
pkginit = parent.join("__init__.py")
|
pkginit = parent.join("__init__.py")
|
||||||
if pkginit.isfile():
|
if pkginit.isfile() and pkginit not in node_cache1:
|
||||||
if pkginit not in node_cache1:
|
|
||||||
col = self._collectfile(pkginit, handle_dupes=False)
|
col = self._collectfile(pkginit, handle_dupes=False)
|
||||||
if col:
|
if col:
|
||||||
if isinstance(col[0], Package):
|
if isinstance(col[0], Package):
|
||||||
|
|
|
@ -644,8 +644,7 @@ class Package(Module):
|
||||||
if ihook.pytest_ignore_collect(path=path, config=self.config):
|
if ihook.pytest_ignore_collect(path=path, config=self.config):
|
||||||
return False
|
return False
|
||||||
norecursepatterns = self.config.getini("norecursedirs")
|
norecursepatterns = self.config.getini("norecursedirs")
|
||||||
for pat in norecursepatterns:
|
if any(path.check(fnmatch=pat) for pat in norecursepatterns):
|
||||||
if path.check(fnmatch=pat):
|
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue