Skip to content
Permalink
Browse files

Better the fix for pytest-dev#3742.

  • Loading branch information...
turturica turturica
turturica authored and turturica committed Aug 10, 2018
1 parent d0bd01b commit 417c742534f3fa504deb7f18c21d2cdb0ad68f56
Showing with 4 additions and 3 deletions.
  1. +3 −2 src/_pytest/main.py
  2. +1 −1 testing/test_collection.py
@@ -505,8 +505,9 @@ def _collect(self, arg):
root = self._node_cache[pkginit]
else:
col = root._collectfile(pkginit)
if col and isinstance(col, Package):
root = col[0]
if col:
if isinstance(col[0], Package):
root = col[0]
self._node_cache[root.fspath] = root

# If it's a directory argument, recurse and look for any Subpackages.
@@ -647,7 +647,7 @@ def test_pkgfile(self, testdir):
col = testdir.getnode(config, x)
assert isinstance(col, pytest.Module)
assert col.name == "x.py"
assert col.parent.parent is None
assert col.parent.parent.parent is None
for col in col.listchain():
assert col.config is config

0 comments on commit 417c742

Please sign in to comment.
You can’t perform that action at this time.