{
  "id": "python/pytest-parametrize-ids-none",
  "signature": "TypeError: ids must be a list of strings or None, got <class 'int'>",
  "signature_zh": "类型错误：ids必须是字符串列表或None，得到int类型",
  "regex": "TypeError:\\ ids\\ must\\ be\\ a\\ list\\ of\\ strings\\ or\\ None,\\ got\\ <class\\ 'int'>",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "在@pytest.mark.parametrize中，ids参数传入了非字符串类型，如整数。",
  "root_cause_type": "generic",
  "root_cause_zh": "parametrize的ids参数类型错误，应为字符串列表或None。",
  "versions": [
    {
      "version": "3.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "如果转换不当，可能生成重复id。",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "测试报告可读性下降。",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 1.0,
      "how": "@pytest.mark.parametrize('param', [1, 2], ids=['one', 'two'])",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "def id_fn(val):\n    return f'param_{val}'\n@pytest.mark.parametrize('param', [1, 2], ids=id_fn)",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-07-11",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}