Fix #3751
This commit is contained in:
parent
4d8903fd0b
commit
266f05c4c4
|
@ -505,8 +505,9 @@ class Session(nodes.FSCollector):
|
|||
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 @@ class Test_getinitialnodes(object):
|
|||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue