Cleanup/follow-up to #4319
This commit is contained in:
parent
7ab3d818f0
commit
a6ff5e6bfc
|
@ -386,6 +386,7 @@ class Session(nodes.FSCollector):
|
||||||
self._initialpaths = frozenset()
|
self._initialpaths = frozenset()
|
||||||
# Keep track of any collected nodes in here, so we don't duplicate fixtures
|
# Keep track of any collected nodes in here, so we don't duplicate fixtures
|
||||||
self._node_cache = {}
|
self._node_cache = {}
|
||||||
|
# Dirnames of pkgs with dunder-init files.
|
||||||
self._pkg_roots = {}
|
self._pkg_roots = {}
|
||||||
|
|
||||||
self.config.pluginmanager.register(self, name="session")
|
self.config.pluginmanager.register(self, name="session")
|
||||||
|
@ -535,8 +536,7 @@ class Session(nodes.FSCollector):
|
||||||
seen_dirs.add(dirpath)
|
seen_dirs.add(dirpath)
|
||||||
pkginit = dirpath.join("__init__.py")
|
pkginit = dirpath.join("__init__.py")
|
||||||
if pkginit.exists():
|
if pkginit.exists():
|
||||||
collect_root = self._pkg_roots.get(dirpath, self)
|
for x in self._collectfile(pkginit):
|
||||||
for x in collect_root._collectfile(pkginit):
|
|
||||||
yield x
|
yield x
|
||||||
if isinstance(x, Package):
|
if isinstance(x, Package):
|
||||||
self._pkg_roots[dirpath] = x
|
self._pkg_roots[dirpath] = x
|
||||||
|
|
Loading…
Reference in New Issue