{
  "id": "python/pytest-assert-raises-no-exception",
  "signature": "Failed: DID NOT RAISE <class 'ValueError'>",
  "signature_zh": "失败：未抛出ValueError异常",
  "regex": "Failed:\\ DID\\ NOT\\ RAISE\\ <class\\ 'ValueError'>",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "使用pytest.raises期望抛出特定异常，但代码没有抛出，导致测试失败。",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest.raises期望异常，但代码未抛出，测试失败。",
  "versions": [
    {
      "version": "3.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "掩盖了代码逻辑错误。",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "与pytest.raises冲突，且不必要。",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "def func():\n    raise ValueError('invalid')\nwith pytest.raises(ValueError):\n    func()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "with pytest.raises(ValueError, match='invalid'):\n    func()",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-02-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}