Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import os
"""Pytest collection config: keep the scratch package (taped/scrap) out of collection.

Uses the pytest>=7 ``collection_path``/``config`` hook signature — the legacy
one-argument ``pytest_ignore_collect(path)`` form was removed in pytest 9 and
made every CI run fail with a PluginValidationError before any test ran.
"""
import pathlib


def pytest_ignore_collect(path):
def pytest_ignore_collect(collection_path: pathlib.Path, config) -> bool:
root_dir = pathlib.Path(__file__).parent.resolve()
scrap_dir = pathlib.PurePath(root_dir, "taped", "scrap")
return str(scrap_dir) in str(path)
scrap_dir = root_dir / "taped" / "scrap"
return scrap_dir == collection_path or scrap_dir in collection_path.parents
Loading