Skip to content

Commit

Permalink
test(fix): pytest_ignore_collect needs to return None for no opinion
Browse files Browse the repository at this point in the history
From https://pytest.org/en/7.4.x/changelog.html#pytest-7-4-0-2023-06-23

> #11081: The norecursedirs check is now performed in a pytest_ignore_collect implementation, so plugins can affect it.
>
> If after updating to this version you see that your norecursedirs 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 to return None instead of False for paths your hook doesn’t want to ignore.
  • Loading branch information
Ned Batchelder authored and nedbat committed Aug 4, 2023
1 parent ebece8a commit 0f9437e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytest_repo_health/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def pytest_ignore_collect(path, config):
if config.getoption("repo_health"):
if "/repo_health" not in str(path):
return True
return False
return None


# Unused argument "session", but pylint complains if it is renamed "_session"
Expand Down

0 comments on commit 0f9437e

Please sign in to comment.