Fix collection of direct symlinked files not in python_files

Fixes https://github.com/pytest-dev/pytest/issues/4325.
This commit is contained in:
Daniel Hahler
2018-11-08 01:24:38 +01:00
parent 7ab3d818f0
commit be15ad8d25
4 changed files with 58 additions and 2 deletions

View File

@@ -488,7 +488,7 @@ class Session(nodes.FSCollector):
from _pytest.python import Package
names = self._parsearg(arg)
argpath = names.pop(0).realpath()
argpath = names.pop(0)
# Start with a Session root, and delve to argpath item (dir or file)
# and stack all Packages found on the way.
@@ -636,7 +636,7 @@ class Session(nodes.FSCollector):
"file or package not found: " + arg + " (missing __init__.py?)"
)
raise UsageError("file not found: " + arg)
parts[0] = path
parts[0] = path.realpath()
return parts
def matchnodes(self, matching, names):