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] omit overwrites [run] omit #622

Closed
nedbat opened this issue Dec 7, 2017 · 6 comments
Closed

[report] omit overwrites [run] omit #622

nedbat opened this issue Dec 7, 2017 · 6 comments
Labels
bug Something isn't working run

Comments

@nedbat
Copy link
Owner

nedbat commented Dec 7, 2017

Originally reported by Max Nordlund (Bitbucket: maxnordlund, GitHub: maxnordlund)


First let me say thanks for providing such an amazing tool, really makes a huge difference for code health.

I'm using pytest-cov, but it doesn't parse the .coveragerc so I believe it's a coverage bug. Basically if you provide an omit option in [run] and [report] the last in the file wins.

This is because both store their value in _omit, as you can see here. I'm not sure how to fix it though, as I just started to read through the source.


@nedbat
Copy link
Owner Author

nedbat commented Dec 7, 2017

Thanks for using coverage.py. Can you provide more detail? If reporting is going to omit a file, then why is it a problem for run to omit it?

@nedbat
Copy link
Owner Author

nedbat commented Dec 8, 2017

Original comment by Max Nordlund (Bitbucket: maxnordlund, GitHub: maxnordlund)


I want to exclude some files completely, not contributing to the global
coverage score, but there are some I would like to avoid in the report even if
they contribute to the total.

It sounds kind of weird, but it's to reduce noise until coverage goes up
enough. It's a legacy project and ~50% is covered so for now I want to filter
out a bit more aggressively. But at the same time don't get the false
impression that coverage is going up. Something like how :skip-covered
reports how many files it skipped, and improves signal-to-noise.

Now, it would be sort of OK for run to omit what report is omitting, but it
currently it overwrites the run omit with the report omit, which means it let's
through a bunch of files that shouldn't be covered.

Does this make it clearer?

@nedbat
Copy link
Owner Author

nedbat commented Jan 21, 2018

Fixed in 1031ead7ca4c (bb)

@nedbat
Copy link
Owner Author

nedbat commented Jan 21, 2018

Don't confuse run-include with report-include (and also omit). Fixes #621 and #622.

→ <<cset 1031ead7ca4c (bb)>>

@nedbat
Copy link
Owner Author

nedbat commented Feb 3, 2018

This was included in coverage.py v4.5, released today.

@nedbat
Copy link
Owner Author

nedbat commented Feb 4, 2018

Original comment by Max Nordlund (Bitbucket: maxnordlund, GitHub: maxnordlund)


Thank you

@nedbat nedbat closed this as completed Feb 4, 2018
@nedbat nedbat added minor bug Something isn't working run labels Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working run
Projects
None yet
Development

No branches or pull requests

1 participant