From ce0e46f4a084602159c89f9a5ea0ccdd56fb93ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 28 May 2024 10:09:47 +0200 Subject: [PATCH] fix `pytest_ignore_collect` not to block default pytest code Fix `pytest_ignore_collect` hook implementation to return `None` rather than `False` when the path ought not to be ignored. This is necessary to enable the default pytest implementation of `pytest_ignore_collect()` to be used. Otherwise, the default rules are never applied and e.g. `--ignore` does not work. I've also reported https://github.com/pytest-dev/pytest/issues/12383 about the misleading documentation. --- conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 5904e75e..84911d02 100644 --- a/conftest.py +++ b/conftest.py @@ -19,4 +19,4 @@ def pytest_ignore_collect(collection_path): """Text collection function executed by pytest""" if not WITH_ASYNC and basename(str(collection_path)) in async_files: return True - return False + return None