summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2018-11-07 21:32:51 +0100
committerDaniel Hahler <git@thequod.de>2018-11-11 01:38:34 +0100
commita6ff5e6bfc117f9151c6506a5f6f4bba51a1676c (patch)
treef1481503f995aedd5c3aefb18f1247af1f69c8bb
parent7ab3d818f03331ebf2765f6c4ea005b721b1c3fe (diff)
downloadpytest-a6ff5e6bfc117f9151c6506a5f6f4bba51a1676c.tar.gz
Cleanup/follow-up to #4319
-rw-r--r--src/_pytest/main.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/_pytest/main.py b/src/_pytest/main.py
index 910812419..9f4340b5a 100644
--- a/src/_pytest/main.py
+++ b/src/_pytest/main.py
@@ -386,6 +386,7 @@ class Session(nodes.FSCollector):
self._initialpaths = frozenset()
# Keep track of any collected nodes in here, so we don't duplicate fixtures
self._node_cache = {}
+ # Dirnames of pkgs with dunder-init files.
self._pkg_roots = {}
self.config.pluginmanager.register(self, name="session")
@@ -535,8 +536,7 @@ class Session(nodes.FSCollector):
seen_dirs.add(dirpath)
pkginit = dirpath.join("__init__.py")
if pkginit.exists():
- collect_root = self._pkg_roots.get(dirpath, self)
- for x in collect_root._collectfile(pkginit):
+ for x in self._collectfile(pkginit):
yield x
if isinstance(x, Package):
self._pkg_roots[dirpath] = x