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

699 views Asked by At

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.

2

There are 2 answers

0
James Mills On BEST ANSWER

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

0
Brylie Christopher Oxley On

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.