coverage
coverage copied to clipboard
Add `--fail-under` option
Description
While generating coverage reports is super important, in order to use coverage in CI workflows, sometimes you want to enforce a certain coverage percentage.
Python's coverage library do that using the --fail-under flag which cause the coverage method to fail if coverage percentage is under than expected.
API
Simply add the --fail-under flag to the coverage execution with the desired coverage percentage. For example, --fail-under=90 will enforce at least 90% coverage and --fail-under=100 will enfore total coverage (100%).