-
Notifications
You must be signed in to change notification settings - Fork 214
Option to disable coverage when only a subset of tests are run #562
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
Isn't |
I can do this piecemeal with flags, but I'd like something that does it automatically. If I just run one test and I forget to turn off coverage reporting it's annoying because I get the coverage report at the end. OTOH I could leave it off by default, but then if I run the full suite and forget to turn it on I would have to run the whole suite again. |
I discovered an issue. The above doesn't work when using
It seems the coverage object doesn't like having stop() called twice in a row on it without calling start() in between. It turns out that even without the above change,
|
I have a library that I am maintaining at 100% coverage, which I do by configuring coverage to fail below 100% and configuring pytest-cov with
--cov=mylib/ --cov-report=term-missing
inpytest.ini
. However, this report is useless whenever I run only a subset of the tests.I've been able to get the behavior I want using the hints from #418 (comment) with something like
However, it would be convenient if this were just a flag I could pass to pytest.
The text was updated successfully, but these errors were encountered: