Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 525
Bentley4 Avatar asked Sep 13 '25 10:09

Bentley4


1 Answers

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.

  • https://coverage.readthedocs.io/en/6.5.0/config.html#report-skip-covered
like image 169
Brylie Christopher Oxley Avatar answered Sep 16 '25 01:09

Brylie Christopher Oxley