{
  "id": "python/pytest-cov-fail-under",
  "signature": "FAIL Required test coverage of 80% not reached. Total coverage: 75.00%",
  "signature_zh": "FAIL 未达到要求的80%测试覆盖率。总覆盖率：75.00%",
  "regex": "FAIL\\ Required\\ test\\ coverage\\ of\\ 80%\\ not\\ reached\\.\\ Total\\ coverage:\\ 75\\.00%",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The test suite's coverage is below the threshold set by --cov-fail-under. This causes pytest to exit with a non-zero status, failing CI.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试套件的覆盖率低于 --cov-fail-under 设置的阈值。这导致 pytest 以非零状态退出，使 CI 失败。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This may pass CI but reduces the quality gate, allowing coverage to drop further over time.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This disables the coverage check entirely, eliminating the quality gate.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This is a form of cheating and may hide genuinely untested code.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Use coverage report to identify missing lines:\ncoverage report -m\nThen add tests targeting those lines.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "In .coveragerc:\n[run]\nomit =\n    */tests/*\n    */migrations/*",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "Use # pragma: no branch for branches that are impossible to test.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-08-15",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}