From 1d103e5cdc1cb08f332e61a5b20fb205fa5228e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 17:41:35 +0000 Subject: [PATCH] [8.2.x] Clarify pytest_ignore_collect docs (#12386) Co-authored-by: Bruno Oliveira --- src/_pytest/hookspec.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index 9ec9b3b5e10..b19cd3272a9 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -310,7 +310,12 @@ def pytest_collection_finish(session: "Session") -> None: def pytest_ignore_collect( collection_path: Path, path: "LEGACY_PATH", config: "Config" ) -> Optional[bool]: - """Return True to prevent considering this path for collection. + """Return ``True`` to ignore this path for collection. + + Return ``None`` to let other plugins ignore the path for collection. + + Returning ``False`` will forcefully *not* ignore this path for collection, + without giving a chance for other plugins to ignore this path. This hook is consulted for all files and directories prior to calling more specific hooks.