{
  "id": "python/pytest-parametrize-arg-count-mismatch",
  "signature": "ValueError: 2 parameters passed to 'test_add' but expected 1",
  "signature_zh": "值错误：向 'test_add' 传递了 2 个参数，但预期 1 个",
  "regex": "ValueError:\\ 2\\ parameters\\ passed\\ to\\ 'test_add'\\ but\\ expected\\ 1",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The @pytest.mark.parametrize decorator provides a number of arguments that does not match the test function's parameter list, causing a ValueError.",
  "root_cause_type": "generic",
  "root_cause_zh": "@pytest.mark.parametrize 装饰器提供的参数数量与测试函数的参数列表不匹配，导致 ValueError。",
  "versions": [
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Adding extra parameters to the test function without updating the parametrize decorator may fix the count but could break other tests.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Removing arguments from the decorator without adjusting the test function leads to missing required parameters.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Ensure the number of arguments in the parametrize decorator matches the test function's parameters. For example, if the test expects (a, b), use @pytest.mark.parametrize('a,b', [(1,2)])",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.8,
      "how": "Use a single argument with a tuple or list if the test function accepts one parameter that contains multiple values.",
      "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": "2024-11-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}