Fix #3751
This commit is contained in:
parent
4d8903fd0b
commit
266f05c4c4
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue