{
  "id": "python/pytest-parametrize-arguments-count",
  "signature": "TypeError: test_func() missing 1 required positional argument: 'b'",
  "signature_zh": "类型错误：test_func() 缺少1个必需的位置参数：'b'",
  "regex": "TypeError:\\ test_func\\(\\)\\ missing\\ 1\\ required\\ positional\\ argument:\\ 'b'",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "在 @pytest.mark.parametrize 中提供的参数数量与测试函数参数数量不一致。",
  "root_cause_type": "generic",
  "root_cause_zh": "在 @pytest.mark.parametrize 中提供的参数数量与测试函数参数数量不一致。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "使用 *args",
      "why_fails": "尝试将测试函数参数改为 *args，但失去了类型检查",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "提供错误格式",
      "why_fails": "尝试在 parametrize 中只提供一个参数元组，但忘记解包",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "确保参数数量匹配",
      "success_rate": 0.98,
      "how": "@pytest.mark.parametrize('a,b', [(1,2), (3,4)])\ndef test_func(a,b): pass",
      "condition": "",
      "sources": []
    },
    {
      "action": "使用单个元组参数",
      "success_rate": 0.9,
      "how": "@pytest.mark.parametrize('args', [(1,2), (3,4)])\ndef test_func(args):\n    a,b = args",
      "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.93,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-04-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}