{
  "id": "python/pytest-coverage-threshold-fail",
  "signature": "Coverage failure: total of 78.42 is less than fail-under=80.00",
  "signature_zh": "覆盖率失败：总计 78.42 低于 fail-under=80.00",
  "regex": "Coverage\\ failure:\\ total\\ of\\ 78\\.42\\ is\\ less\\ than\\ fail\\-under=80\\.00",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "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.",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest-cov 的 --cov-fail-under 强制最低覆盖率；测得的总覆盖率低于配置阈值，即使所有测试通过也会失败。",
  "versions": [
    {
      "version": "5.0.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "6.0.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Hides untested code and defeats the purpose of the gate; reviewers reject blanket pragma usage.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Removes the gate entirely; regressions slip through and the metric becomes meaningless.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "# pyproject.toml\n[tool.coverage.run]\nsource = [\"myapp\"]\nomit = [\"myapp/migrations/*\", \"*/tests/*\"]\n\n[tool.coverage.report]\nfail_under = 80\nshow_missing = true",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.92,
      "how": "pytest --cov=myapp --cov-report=term-missing --cov-fail-under=80\n# Focus on 'Missing' column to add tests",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-03-19",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}