-
Notifications
You must be signed in to change notification settings - Fork 213
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
Allow setting skip_covered to False for HTML #449
Comments
I really wish we could stop adding reporting options to pytest-cov, and just have people use the coverage reporting commands directly. There's no need for pytest to produce coverage reports. It just leads to crazy command-line options like you are proposing. |
Using pytest-cov over the corresponding 4 direct commands shaves off 1 second runtime overhead (I assume because there's less interpreter start-up time to be paid). This is my my reason at the moment preferring the plug-in over direct commands. |
I understand that I am in the minority here, but: Your one second savings: what is that as a percentage of the test suite runtime? |
In my case, the test suite takes around 25s or so. If every tool starts injecting a second here and a second there without any benefit it quickly adds up. Especially considering this kind of coverage reporting often runs in CIs where you literally have to pay per time used. And this 1s is not a one time cost, is every commit cost. |
This now can be solved via nedbat/coveragepy#1090 |
For CLI output it's common to set
skip-covered=True
in the config file; however, in HTML export you want to set this False so you can see what test covers what line. There's a new flag in this in the API:In this case https://github.com/pytest-dev/pytest-cov/blob/master/src/pytest_cov/engine.py#L189 should allow specifying as False (see skip_covered https://github.com/nedbat/coveragepy/blob/0b1dd531f23d8ba313ee685b156b07f76fa680d5/coverage/cmdline.py#L623).
The one danger is that this flag needs to be somehow specified by the user. Potential options for this:
Should we perhaps set this always to False for HTML report? cc @asottile
PS. coveragepy ticket for perhaps a config side solution nedbat/coveragepy#1090
The text was updated successfully, but these errors were encountered: