# pytest/coverage

> Runs pytest with coverage, and fails on a broken test or a covered share under the floor.

Runs pytest with coverage, and fails on a broken test or a covered share under the floor.

Part of the [`pytest`](/reference/configurations/pytest/) configuration, at the `recommended` [level](/start/concepts/#levels). It runs at the `push` [stage](/start/concepts/#stage), once per scope. It runs pytest.

## Why

Coverage shows the Python branches and lines that no test runs, before a push.

## What to do

Fix the failed test, or cover the lines the report marks. Lower `coverage.lines` only with a reason.

## Example

pytest-cov reports `FAIL Required test coverage of 90% not reached. Total coverage: 85%`. Add a Python test for the uncovered behavior.

## Turn it off

Turn it off for some files, or one of its lint rules, with a reason:

```shell
gspot ignore pytest/coverage --paths "<glob>" --reason "<why>"
gspot ignore pytest/coverage --rule <rule> --reason "<why>"
```

To silence one place, write a comment such as:

```text
if TYPE_CHECKING:  # pragma: no cover # imports for type checkers only
```
