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

Report no-cover lines #814

Open
jml opened this issue Jun 17, 2019 · 2 comments
Open

Report no-cover lines #814

jml opened this issue Jun 17, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@jml
Copy link

jml commented Jun 17, 2019

Is your feature request related to a problem? Please describe.
We use pragma: no cover to mark sections of code that are impractically difficult to test. This way, we can use "100% coverage" to mean "we have made a conscious decision to not test some code" or "there is nothing untested by accident".

That said, all that deliberately, consciously untested code is still a risk. It would be nice to know how much of a risk we're carrying by having some way to identify excluded code.

Describe the solution you'd like
The coverage report should also include the number of lines excluded.

Describe alternatives you've considered
Grepping for no cover gets us a part of the way, and is a reasonable way of auditing. It's hard to guess how much damage any individual no cover might cause.

Additional context
#251 is very similar, but is about reporting on excluded lines that ended up being covered.

@jml jml added the enhancement New feature or request label Jun 17, 2019
@nedbat
Copy link
Owner

nedbat commented Jun 17, 2019

This is an interesting idea. I guess you are talking about the text report (coverage report)? We could add a column to count the excluded lines. Have you looked at the HTML report? It already has a column for Excluded, and the individual file pages can show the excluded lines (highlighted in gray).

@jml
Copy link
Author

jml commented Jun 17, 2019

Thanks! Yes, I am talking about the text report. I think what I'd really like is both a column as you describe and a --show-excluded option that shows line numbers of statements in each module that were excluded.

I didn't know that about the HTML report—that's neat! I don't look at it very much since our build automation runs the text report. I'll definitely use it next time I'm on a coverage-improving rampage.

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

No branches or pull requests

2 participants