1. Ned Batchelder
  2. coverage.py
  3. Issues
Issue #549 resolved

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

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

    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.

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

  3. Log in to comment