# FAIL 未达到要求的80%测试覆盖率。总覆盖率：75.00%

- **ID:** `python/pytest-cov-fail-under`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

测试套件的覆盖率低于 --cov-fail-under 设置的阈值。这导致 pytest 以非零状态退出，使 CI 失败。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (95% 成功率)
   ```
   Use coverage report to identify missing lines:
coverage report -m
Then add tests targeting those lines.
   ```
2. **** (90% 成功率)
   ```
   In .coveragerc:
[run]
omit =
    */tests/*
    */migrations/*
   ```
3. **** (80% 成功率)
   ```
   Use # pragma: no branch for branches that are impossible to test.
   ```

## 无效尝试

- **** — This may pass CI but reduces the quality gate, allowing coverage to drop further over time. (70% 失败率)
- **** — This disables the coverage check entirely, eliminating the quality gate. (90% 失败率)
- **** — This is a form of cheating and may hide genuinely untested code. (95% 失败率)
