-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
pytest --doctest-modules crashes on file-level __test__ = False
#11730
Comments
This looks like a issue with the stdlib |
@RonnyPfannschmidt do you have any idea on how to investigate or fix? |
based on https://docs.python.org/3/library/doctest.html#which-docstrings-are-examined the code in the stdlib is incorrect, a upstream bug needs to be opened |
Thanks, I tested Where would such a bug be opened? python/cpython? |
cpython |
There is a workaround. I had the same problem and this is how I 'fixed' it. Instead of using :
do this:
|
Where is this documented and what's the difference? Why not just |
A file level
__test__ = False
succesfully stopspytest
from collecting any test from that file, however when runningpytest --doctest- modules
on the same file, this error appears:It's enoough to have a file with only this content to see the behavior:
Version:
pytest 7.4.3
The text was updated successfully, but these errors were encountered: