Merge pull request #3751 from nicoddemus/collect-file-bug

Workaround for #3742
This commit is contained in:
Ronny Pfannschmidt
2018-08-02 07:35:46 +02:00
committed by GitHub
6 changed files with 21 additions and 2 deletions

View File

@@ -482,6 +482,8 @@ class Session(nodes.FSCollector):
self.trace.root.indent -= 1
def _collect(self, arg):
from _pytest.python import Package
names = self._parsearg(arg)
argpath = names.pop(0)
paths = []
@@ -503,7 +505,7 @@ class Session(nodes.FSCollector):
root = self._node_cache[pkginit]
else:
col = root._collectfile(pkginit)
if col:
if col and isinstance(col, Package):
root = col[0]
self._node_cache[root.fspath] = root