This commit is contained in:
turturica 2018-08-09 18:28:22 -07:00
parent 4d8903fd0b
commit 266f05c4c4
2 changed files with 4 additions and 3 deletions

View File

@ -505,7 +505,8 @@ class Session(nodes.FSCollector):
root = self._node_cache[pkginit] root = self._node_cache[pkginit]
else: else:
col = root._collectfile(pkginit) col = root._collectfile(pkginit)
if col and isinstance(col, Package): if col:
if isinstance(col[0], Package):
root = col[0] root = col[0]
self._node_cache[root.fspath] = root self._node_cache[root.fspath] = root

View File

@ -647,7 +647,7 @@ class Test_getinitialnodes(object):
col = testdir.getnode(config, x) col = testdir.getnode(config, x)
assert isinstance(col, pytest.Module) assert isinstance(col, pytest.Module)
assert col.name == "x.py" assert col.name == "x.py"
assert col.parent.parent is None assert col.parent.parent.parent is None
for col in col.listchain(): for col in col.listchain():
assert col.config is config assert col.config is config