remove paths/parts
This commit is contained in:
parent
f8b944dee0
commit
bbb9d72c13
|
@ -18,7 +18,6 @@ from _pytest.config import directory_arg
|
||||||
from _pytest.config import hookimpl
|
from _pytest.config import hookimpl
|
||||||
from _pytest.config import UsageError
|
from _pytest.config import UsageError
|
||||||
from _pytest.outcomes import exit
|
from _pytest.outcomes import exit
|
||||||
from _pytest.pathlib import parts
|
|
||||||
from _pytest.runner import collect_one_node
|
from _pytest.runner import collect_one_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -489,7 +488,6 @@ class Session(nodes.FSCollector):
|
||||||
|
|
||||||
names = self._parsearg(arg)
|
names = self._parsearg(arg)
|
||||||
argpath = names.pop(0).realpath()
|
argpath = names.pop(0).realpath()
|
||||||
paths = set()
|
|
||||||
pkg_roots = {}
|
pkg_roots = {}
|
||||||
|
|
||||||
root = self
|
root = self
|
||||||
|
@ -539,21 +537,19 @@ class Session(nodes.FSCollector):
|
||||||
if dirpath not in seen_dirs:
|
if dirpath not in seen_dirs:
|
||||||
seen_dirs.add(dirpath)
|
seen_dirs.add(dirpath)
|
||||||
pkginit = dirpath.join("__init__.py")
|
pkginit = dirpath.join("__init__.py")
|
||||||
if pkginit.exists() and parts(pkginit.strpath).isdisjoint(paths):
|
if pkginit.exists():
|
||||||
for x in collect_root._collectfile(pkginit):
|
for x in collect_root._collectfile(pkginit):
|
||||||
yield x
|
yield x
|
||||||
if isinstance(x, Package):
|
if isinstance(x, Package):
|
||||||
pkg_roots[dirpath] = x
|
pkg_roots[dirpath] = x
|
||||||
paths.add(x.fspath.dirpath())
|
|
||||||
|
|
||||||
if True or parts(path.strpath).isdisjoint(paths):
|
for x in collect_root._collectfile(path):
|
||||||
for x in collect_root._collectfile(path):
|
key = (type(x), x.fspath)
|
||||||
key = (type(x), x.fspath)
|
if key in self._node_cache:
|
||||||
if key in self._node_cache:
|
yield self._node_cache[key]
|
||||||
yield self._node_cache[key]
|
else:
|
||||||
else:
|
self._node_cache[key] = x
|
||||||
self._node_cache[key] = x
|
yield x
|
||||||
yield x
|
|
||||||
else:
|
else:
|
||||||
assert argpath.check(file=1)
|
assert argpath.check(file=1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue