From 0dc65193a88d7151fe0e68154bc2a4df54d5b065 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 10 Jun 2023 21:37:34 +0300 Subject: [PATCH] changelog: add note to `norecursedir`/`pytest_ignore_collect` change --- changelog/11081.improvement.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog/11081.improvement.rst b/changelog/11081.improvement.rst index 227e478d4..60fa4e3ed 100644 --- a/changelog/11081.improvement.rst +++ b/changelog/11081.improvement.rst @@ -1 +1,7 @@ The :confval:`norecursedir` check is now performed in a :hook:`pytest_ignore_collect` implementation, so plugins can affect it. + +If after updating to this version you see that your `norecursedir` setting is not being respected, +it means that a conftest or a plugin you use has a bad `pytest_ignore_collect` implementation. +Most likely, your hook returns `False` for paths it does not want to ignore, +which ends the processing and doesn't allow other plugins, including pytest itself, to ignore the path. +The fix is simple - return `None` instead of `False` for paths your hook doesn't want to ignore.