Skip to content

Commit a6ff5e6

Browse files
committed
Cleanup/follow-up to #4319
1 parent 7ab3d81 commit a6ff5e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_pytest/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ def __init__(self, config):
386386
self._initialpaths = frozenset()
387387
# Keep track of any collected nodes in here, so we don't duplicate fixtures
388388
self._node_cache = {}
389+
# Dirnames of pkgs with dunder-init files.
389390
self._pkg_roots = {}
390391

391392
self.config.pluginmanager.register(self, name="session")
@@ -535,8 +536,7 @@ def filter_(f):
535536
seen_dirs.add(dirpath)
536537
pkginit = dirpath.join("__init__.py")
537538
if pkginit.exists():
538-
collect_root = self._pkg_roots.get(dirpath, self)
539-
for x in collect_root._collectfile(pkginit):
539+
for x in self._collectfile(pkginit):
540540
yield x
541541
if isinstance(x, Package):
542542
self._pkg_roots[dirpath] = x

0 commit comments

Comments
 (0)