-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
pytest_ignore_collect
documentation is misleading
#12383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
mgorny
added a commit
to mgorny/typeguard
that referenced
this issue
May 28, 2024
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.
3 tasks
mgorny
added a commit
to mgorny/transitions
that referenced
this issue
May 28, 2024
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.
aleneum
pushed a commit
to pytransitions/transitions
that referenced
this issue
May 28, 2024
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.
nicoddemus
added a commit
that referenced
this issue
May 28, 2024
nicoddemus
added a commit
that referenced
this issue
May 28, 2024
Fixes #12383 Co-authored-by: Ran Benita <[email protected]>
Thanks! Could you also make it clear that "other plugins" include "built-in" pytest behavior? |
I'm short on time, but feel free to open a PR with any other suggestions. 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm reporting this as a bug because I've hit this multiple times in the wild in a variety of packages implementing
pytest_ignore_collect
inconftest.py
.The documentation for
pytest_ignore_collect
states:While this isn't incorrect, it's misleading. A lot of implementations I've seen assume they're supposed to return
False
for paths that are not to be ignored. In fact, I didn't realize that returningNone
was the right thing to do, unless I've found this bit in the changelog:Could you please improve the documentation for
pytest_ignore_collect
to make it clear that normallyTrue
orNone
should be returned? This is especially problematic since returningFalse
makes--ignore
silently ignored.The text was updated successfully, but these errors were encountered: