{
  "id": "python/pytest-assertion-with-tuple",
  "signature": "AssertionError: assert (1, 2) == (1, 3)",
  "signature_zh": "断言错误：断言(1, 2)等于(1, 3)",
  "regex": "AssertionError:\\ assert\\ \\(1,\\ 2\\)\\ ==\\ \\(1,\\ 3\\)",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "在pytest中，直接比较元组时，如果元素不相等，pytest会显示详细差异，但根本原因是测试逻辑错误或数据未更新。",
  "root_cause_type": "generic",
  "root_cause_zh": "测试中比较元组时，期望值与实际值不一致，导致断言失败。",
  "versions": [
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "无法比较整个元组的逻辑，且可能忽略其他元素。",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "测试失去意义，无法捕获错误。",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "assert actual_tuple == expected_tuple  # 确保expected_tuple正确",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "assert (1.0, 2.0) == pytest.approx((1.0, 2.0001))",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}