From 9f121e85a78310e50acde71082dc0df3e5ce895c Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 28 May 2024 13:47:00 -0300 Subject: [PATCH] Clarify pytest_ignore_collect docs (#12385) Fixes #12383 Co-authored-by: Ran Benita --- 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 8a38ff4fb43..c7f9d036c33 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -311,7 +311,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.