# Coverage failure: total of 78.42 is less than fail-under=80.00

- **ID:** `python/pytest-coverage-threshold-fail`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pytest-cov's --cov-fail-under enforces a minimum coverage; the measured total is below the configured threshold, failing the run even if all tests pass.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 5.0.x | active | — | — |
| 6.0.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   # pyproject.toml
[tool.coverage.run]
source = ["myapp"]
omit = ["myapp/migrations/*", "*/tests/*"]

[tool.coverage.report]
fail_under = 80
show_missing = true
   ```
2. **** (92% success)
   ```
   pytest --cov=myapp --cov-report=term-missing --cov-fail-under=80
# Focus on 'Missing' column to add tests
   ```

## Dead Ends

- **** — Hides untested code and defeats the purpose of the gate; reviewers reject blanket pragma usage. (80% fail)
- **** — Removes the gate entirely; regressions slip through and the metric becomes meaningless. (85% fail)
