Skip to content

Commit 2345435

Browse files
rootroot
authored andcommitted
Ignore build and dist only if setuptools present
1 parent 01fae08 commit 2345435

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/_pytest/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,11 @@ def pytest_ignore_collect(collection_path: Path, config: Config) -> bool | None:
421421
if any(fnmatch_ex(pat, collection_path) for pat in norecursepatterns):
422422
return True
423423

424+
if any(fnmatch_ex(pat, collection_path) for pat in ("build", "dist")):
425+
parent = collection_path.parent
426+
if (parent / "setup.py").exists() or (parent / "setup.cfg").exists():
427+
return True
428+
424429
return None
425430

426431

0 commit comments

Comments
 (0)