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):
|
||||
return False
|
||||
norecursepatterns = self.config.getini("norecursedirs")
|
||||
for pat in norecursepatterns:
|
||||
if path.check(fnmatch=pat):
|
||||
if any(path.check(fnmatch=pat) for pat in norecursepatterns):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
@ -650,8 +649,7 @@ class Session(nodes.FSCollector):
|
|||
|
||||
if parent.isdir():
|
||||
pkginit = parent.join("__init__.py")
|
||||
if pkginit.isfile():
|
||||
if pkginit not in node_cache1:
|
||||
if pkginit.isfile() and pkginit not in node_cache1:
|
||||
col = self._collectfile(pkginit, handle_dupes=False)
|
||||
if col:
|
||||
if isinstance(col[0], Package):
|
||||
|
|
|
@ -644,8 +644,7 @@ class Package(Module):
|
|||
if ihook.pytest_ignore_collect(path=path, config=self.config):
|
||||
return False
|
||||
norecursepatterns = self.config.getini("norecursedirs")
|
||||
for pat in norecursepatterns:
|
||||
if path.check(fnmatch=pat):
|
||||
if any(path.check(fnmatch=pat) for pat in norecursepatterns):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in New Issue