This commit is contained in:
Riezebos 2023-03-14 21:34:57 +08:00 committed by GitHub
commit fb57480350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -35,6 +35,7 @@ from _pytest.fixtures import FixtureManager
from _pytest.outcomes import exit
from _pytest.pathlib import absolutepath
from _pytest.pathlib import bestrelpath
from _pytest.pathlib import ensure_extended_length_path
from _pytest.pathlib import fnmatch_ex
from _pytest.pathlib import visit
from _pytest.reports import CollectReport
@ -714,6 +715,7 @@ class Session(nodes.FSCollector):
# Let the Package collector deal with subnodes, don't collect here.
if argpath.is_dir():
assert not names, f"invalid arg {(argpath, names)!r}"
argpath = ensure_extended_length_path(Path(argpath))
seen_dirs: Set[Path] = set()
for direntry in visit(str(argpath), self._recurse):