Skip to content

Commit

Permalink
fix pytest_ignore_collect not to block default pytest code
Browse files Browse the repository at this point in the history
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 pytest-dev/pytest#12383
about the misleading documentation.
  • Loading branch information
mgorny authored and aleneum committed May 28, 2024
1 parent dccae40 commit ce0e46f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ce0e46f

Please sign in to comment.