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

Issue #549 resolved
Havoc Pennington created an issue

We run tests something like this:

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.

Comments (8)

  1. Loic 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.

  2. Havoc Pennington reporter

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

  3. Loic 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.

  4. Ned Batchelder repo owner

    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>>

  5. Log in to comment