summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2018-11-07 19:36:19 +0100
committerDaniel Hahler <git@thequod.de>2018-11-07 19:36:19 +0100
commitbbb9d72c1315e73d9acc6a9b8a9488479db76f0b (patch)
treea8a552dda3a02a1bf44d6882c4932cb04b186742
parentf8b944dee0b59bdc483ce505738ea1cb3a57a5b4 (diff)
downloadpytest-bbb9d72c1315e73d9acc6a9b8a9488479db76f0b.tar.gz
remove paths/parts
-rw-r--r--src/_pytest/main.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/_pytest/main.py b/src/_pytest/main.py
index 59e2b6d4d..50bd10979 100644
--- a/src/_pytest/main.py
+++ b/src/_pytest/main.py
@@ -18,7 +18,6 @@ from _pytest.config import directory_arg
from _pytest.config import hookimpl
from _pytest.config import UsageError
from _pytest.outcomes import exit
-from _pytest.pathlib import parts
from _pytest.runner import collect_one_node
@@ -489,7 +488,6 @@ class Session(nodes.FSCollector):
names = self._parsearg(arg)
argpath = names.pop(0).realpath()
- paths = set()
pkg_roots = {}
root = self
@@ -539,21 +537,19 @@ class Session(nodes.FSCollector):
if dirpath not in seen_dirs:
seen_dirs.add(dirpath)
pkginit = dirpath.join("__init__.py")
- if pkginit.exists() and parts(pkginit.strpath).isdisjoint(paths):
+ if pkginit.exists():
for x in collect_root._collectfile(pkginit):
yield x
if isinstance(x, Package):
pkg_roots[dirpath] = x
- paths.add(x.fspath.dirpath())
- if True or parts(path.strpath).isdisjoint(paths):
- for x in collect_root._collectfile(path):
- key = (type(x), x.fspath)
- if key in self._node_cache:
- yield self._node_cache[key]
- else:
- self._node_cache[key] = x
- yield x
+ for x in collect_root._collectfile(path):
+ key = (type(x), x.fspath)
+ if key in self._node_cache:
+ yield self._node_cache[key]
+ else:
+ self._node_cache[key] = x
+ yield x
else:
assert argpath.check(file=1)