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

Option to hide terminal coverage report on test failure #275

Closed
bluenote10 opened this issue Mar 14, 2019 · 5 comments
Closed

Option to hide terminal coverage report on test failure #275

bluenote10 opened this issue Mar 14, 2019 · 5 comments

Comments

@bluenote10
Copy link

This is a feature request related to the term/term-missing reporters. In general I would like to use

addopts =
    --cov=myproject --cov-report term-missing

so that co-developers automatically see coverage stats on stdout. However, for big projects, the coverage reports fills more than an entire page on the screen. In case all tests were successful this is fine, because here the coverage is the most relevant information for the developer. However, if a test fails, coverage isn't so relevant and the user has to scroll back up to get information on the failed test. This can get annoying to the point that I often turn off the reporter during development.

It would be nice to have the option to report coverage to terminal only in the success case.

@ionelmc
Copy link
Member

ionelmc commented Mar 14, 2019

Worth considering this in #199

Would a --cov-report-disable solve it for you?

@bluenote10
Copy link
Author

bluenote10 commented Mar 14, 2019

Would a --cov-report-disable solve it for you?

Not really, because I don't know before running the tests whether it will be successful (and I want to see coverage reports) or whether a test will fail (and I want hide coverage to focus on the failed test information). That's also why enabling/disabling the addopts option all the time gets annoying.

@ionelmc
Copy link
Member

ionelmc commented Mar 25, 2019

@bluenote10 so it turns out there's --no-cov-on-fail - doesn't that solve your problem?

@blueyed
Copy link
Contributor

blueyed commented Mar 25, 2019

Assuming --no-cov-on-fail is what is wanted here.

@blueyed blueyed closed this as completed Mar 25, 2019
@bluenote10
Copy link
Author

Exactly what I was looking for, I simply didn't find it in the documentation.

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

No branches or pull requests

3 participants