Fix collection of testpaths with --pyargs

Fixes https://github.com/pytest-dev/pytest/issues/4405.
This commit is contained in:
Daniel Hahler
2018-11-17 13:28:10 +01:00
parent 9dec146edf
commit a252e81ced
3 changed files with 24 additions and 4 deletions

View File

@@ -852,10 +852,7 @@ class Config(object):
)
if not args:
if self.invocation_dir == self.rootdir:
args = [
str(self.invocation_dir.join(x, abs=True))
for x in self.getini("testpaths")
]
args = self.getini("testpaths")
if not args:
args = [str(self.invocation_dir)]
self.args = args