From df2fccdd4b5aa6ac36bd8ff234616bf1a8c2cdd4 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 28 May 2024 13:14:58 -0300 Subject: [PATCH] Clarify pytest_ignore_collect docs Fixes #12383 --- 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 8a38ff4fb..eb63f6a5a 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 prevent considering this path for collection. + + Return ``None`` to let other plugins ignore the path for collection. + + Returning ``False`` will forcefully consider this path to be considered + for collection, without giving a chance of other plugins to ignore this file. This hook is consulted for all files and directories prior to calling more specific hooks.