testdir runs are affecting coverage, can I tweak to prevent this? #8876
Replies: 1 comment
|
For the pytest-cov behavior used at the time of this thread, the child pytest invocation can explicitly disable pytest-cov: result = testdir.runpytest_subprocess("--no-cov")
There is an important current-version difference, though: modern pytest-cov no longer implements its old subprocess coverage mechanism itself. pytest-cov 7 delegates subprocess measurement to coverage.py, typically using coverage's: [run]
patch = subprocessIf that coverage.py subprocess patch is enabled globally, Also, current pytest documentation generally calls the fixture Please mark this answer as accepted if it helped, thank you. |
Uh oh!
There was an error while loading. Please reload this page.
#8868
While working on the issue I'm asking about in the above link, I am running into an issue with code coverage.
Specifically, when I add a test to my test suite (which uses
testdir, specificallytestdir.runpytest_subprocess(), all of a sudden my coverage drops on my django settings files.Is there something I can do to prevent my test from reverting this coverage?
The added test file:
The coverage report output:
coveragerc file:
All reactions