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

skip-covered with 100% coverage throws a "no data" error #549

Closed
nedbat opened this issue Jan 10, 2017 · 8 comments
Closed

skip-covered with 100% coverage throws a "no data" error #549

nedbat opened this issue Jan 10, 2017 · 8 comments
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Jan 10, 2017

Originally reported by Havoc Pennington (Bitbucket: havocp, GitHub: havocp)


We run tests something like this:

#!shell

python -m pytest -vv --cov=modname --cov-report=term-missing:skip-covered --cov-report=html --cov-fail-under=100 --no-cov-on-fail --cov-config=.coveragerc modname/tests

With 4.2, with 100% coverage this exited successfully, with 4.3.1 it results in "ERROR: Failed to generate report: No data to report."

If I add uncovered code (and remove the fail-under=100), then it exits successfully. If I remove skip-covered then it exits successfully.


@nedbat
Copy link
Owner Author

nedbat commented Jan 10, 2017

Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary)


skip-covered was not implemented in 4.2 and was silently ignored. It was implemented in 4.3 and it looks like the 100% coverage case was forgotten.

@nedbat
Copy link
Owner Author

nedbat commented Jan 10, 2017

Original comment by Havoc Pennington (Bitbucket: havocp, GitHub: havocp)


skip-covered worked for me in 4.2 for the term-missing report but not the html report.

@nedbat
Copy link
Owner Author

nedbat commented Jan 10, 2017

Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary)


The skip-covered option is global. If set once it will apply to all reports that support it. This is why it applies to the html report although it is set for term-missing only.

@nedbat
Copy link
Owner Author

nedbat commented Jan 10, 2017

Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary)


For the record https://bitbucket.org/ned/coveragepy/pull-requests/123/html-total-must-account-for-files-100/diff is the proposed fix for this issue

@nedbat
Copy link
Owner Author

nedbat commented Jan 10, 2017

Original comment by Loic Dachary (Bitbucket: dachary, GitHub: dachary)


@nedbat is there a way to tag this as a regression introduced in 4.3 ?

@nedbat
Copy link
Owner Author

nedbat commented Jan 11, 2017

html total must account for files 100% covered #549

The --skip-covered implementation for html must not just skip the
files that are 100% covered. It must remember them and not fail with a
"no coverage data" when all files are 100% covered.

The statistics about the files that are 100% covered must also be
summed in the total for the index.html page.

close #549

→ <<cset 9158591bba46 (bb)>>

@nedbat
Copy link
Owner Author

nedbat commented Jan 11, 2017

Original comment by Havoc Pennington (Bitbucket: havocp, GitHub: havocp)


Thanks!

@nedbat
Copy link
Owner Author

nedbat commented Jan 17, 2017

This was shipped in 4.3.2.

@nedbat nedbat closed this as completed Jan 17, 2017
@nedbat nedbat added minor bug Something isn't working 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
Projects
None yet
Development

No branches or pull requests

1 participant