(collection_path: Path, config: Config)
| 435 | |
| 436 | |
| 437 | def pytest_ignore_collect(collection_path: Path, config: Config) -> bool | None: |
| 438 | if collection_path.name == "__pycache__": |
| 439 | return True |
| 440 | |
| 441 | ignore_paths = config._getconftest_pathlist( |
| 442 | "collect_ignore", path=collection_path.parent |
| 443 | ) |
| 444 | ignore_paths = ignore_paths or [] |
| 445 | excludeopt = config.getoption("ignore") |
| 446 | if excludeopt: |
| 447 | ignore_paths.extend(absolutepath(x) for x in excludeopt) |
| 448 | |
| 449 | if collection_path in ignore_paths: |
| 450 | return True |
| 451 | |
| 452 | ignore_globs = config._getconftest_pathlist( |
| 453 | "collect_ignore_glob", path=collection_path.parent |
| 454 | ) |
| 455 | ignore_globs = ignore_globs or [] |
| 456 | excludeglobopt = config.getoption("ignore_glob") |
| 457 | if excludeglobopt: |
| 458 | ignore_globs.extend(absolutepath(x) for x in excludeglobopt) |
| 459 | |
| 460 | if any(fnmatch.fnmatch(str(collection_path), str(glob)) for glob in ignore_globs): |
| 461 | return True |
| 462 | |
| 463 | allow_in_venv = config.getoption("collect_in_virtualenv") |
| 464 | if not allow_in_venv and _in_venv(collection_path): |
| 465 | return True |
| 466 | |
| 467 | if collection_path.is_dir(): |
| 468 | norecursepatterns = config.getini("norecursedirs") |
| 469 | if any(fnmatch_ex(pat, collection_path) for pat in norecursepatterns): |
| 470 | return True |
| 471 | |
| 472 | return None |
| 473 | |
| 474 | |
| 475 | def pytest_collect_directory( |
nothing calls this directly
no test coverage detected