{
  "id": "python/unittest-mock-side-effect-assertion-error",
  "signature": "AssertionError: Expected 'foo' to be called with (1,) but was called with (2,)",
  "signature_zh": "断言错误：期望 'foo' 以 (1,) 被调用，但实际以 (2,) 被调用",
  "regex": "AssertionError:\\ Expected\\ 'foo'\\ to\\ be\\ called\\ with\\ \\(1,\\)\\ but\\ was\\ called\\ with\\ \\(2,\\)",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The mock's call arguments don't match the expected arguments, often due to incorrect input or mock configuration.",
  "root_cause_type": "generic",
  "root_cause_zh": "mock 的调用参数与预期参数不匹配，通常是由于输入错误或 mock 配置错误。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This hides the real bug in the code.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "It still fails if arguments don't match.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "print(mock.call_args)\nassert mock.call_args == call(1,)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "mock.assert_any_call(1)",
      "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-08-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}