Skip to content
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

Closed
gaborbernat opened this issue Jan 4, 2021 · 5 comments
Closed

Allow setting skip_covered to False for HTML #449

gaborbernat opened this issue Jan 4, 2021 · 5 comments

Comments

@gaborbernat
Copy link
Contributor

gaborbernat commented Jan 4, 2021

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:

  --no-skip-covered     Disable --skip-covered.

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:

--cov html:out_dir:no-skip-covered

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

@nedbat
Copy link
Collaborator

nedbat commented Jan 10, 2021

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.

@gaborbernat
Copy link
Contributor Author

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.

@nedbat
Copy link
Collaborator

nedbat commented Jan 11, 2021

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?

@gaborbernat
Copy link
Contributor Author

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.

@gaborbernat
Copy link
Contributor Author

This now can be solved via nedbat/coveragepy#1090

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants