{
  "id": "python/pytest-raises-missed-exception",
  "signature": "Failed: DID NOT RAISE <class 'ValueError'>",
  "signature_zh": "Failed: 没有引发 <class 'ValueError'>",
  "regex": "Failed:\\ DID\\ NOT\\ RAISE\\ <class\\ 'ValueError'>",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A test using pytest.raises(ValueError) expects an exception to be raised, but the code executes without raising it.",
  "root_cause_type": "generic",
  "root_cause_zh": "使用 pytest.raises(ValueError) 的测试期望引发异常，但代码执行时没有引发。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This defeats the purpose of the test; it should validate real error conditions.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This can mask other unexpected exceptions and reduce test effectiveness.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Check the code logic to ensure it raises ValueError under the given conditions, and fix if necessary.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Add debug prints to verify the input that should trigger the exception.",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-07-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}