-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
--doctest-modules causes all tests to be executed even when a single test is picked #3077
Comments
GitMate.io thinks the contributor most likely able to help you is @nicoddemus. |
I just realized that even if I add the option in the command line and skip |
Thanks for the report @hameerabbasi. Might have some relation to #1756. |
Selecting tests using
|
If someone can give me a brief overview of what needs to be done to fix this, I'll try my hand at a PR. Edit: It can't be what you suggested @nicoddemus, (because that function isn't even entered into without the command line argument so technically it shouldn't even be called in the buggy case) |
@hameerabbasi thanks for the offer! 😁 Here's the code which collects a Lines 52 to 58 in 44fa5a7
And as can be seen here, it will always run all doctests found inside a module, regardless of any options: Lines 244 to 246 in 44fa5a7
|
This isn't actually a bug - you're actually asking for the tests to be run twice! The
means "Run TLDR; your |
Issue
When
--doctest-modules
is insetup.cfg
, it causes all tests to be run even when a single one is picked. In addition, the selected test runs twice.Environment
conda update --all
already run.Minimal Example
Directory Structure:
setup.cfg
:test_pytest.py
Command line:
Expected
Just
test_two
should be run.Actual
test_one
is run once andtest_two
twice.pip-list
The text was updated successfully, but these errors were encountered: