How to omit reporting files that have 100% coverage in Coverage.py

Question:

Is there a setting I can put in the .coveragerc file under [report] to omit files that have 100% test coverage in my report?

The closest thing I found was the exclude_lines option, but this only works for a regex pattern inside the code of your project, not for the report itself.

Asked By: Bentley4

||

Answers:

I don’t believe so. Try submitting a Feature Request or writing such a feature and submitting a Pull Request.

See: http://nedbatchelder.com/code/coverage/config.html

Answered By: James Mills

As of Coverage.py 4.3.2 is now a --skip-covered flag that can be passed to the pytest coverage report command.

Pytest can also be configured to skip files that have 100% coverage.

Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.