{
  "id": "python/pytest-parametrize-indirect-missing-fixture",
  "signature": "fixture 'request.param' not found\navailable fixtures: ...",
  "signature_zh": "fixture 'request.param' 未找到\n可用 fixtures: ...",
  "regex": "fixture\\ 'request\\.param'\\ not\\ found\\\navailable\\ fixtures:\\ \\.\\.\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "indirect=True in @pytest.mark.parametrize requires the parameter name to match an existing fixture. If the fixture is missing or misnamed, pytest tries to resolve 'request.param' as a fixture and fails.",
  "root_cause_type": "generic",
  "root_cause_zh": "在 @pytest.mark.parametrize 中使用 indirect=True 要求参数名匹配已存在的 fixture。如果 fixture 缺失或命名错误，pytest 会尝试将 'request.param' 解析为 fixture 并失败。",
  "versions": [
    {
      "version": "6.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "7.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Removes the fixture indirection entirely; the test may now receive raw params instead of fixture-processed values, breaking test logic.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Fixture names cannot contain dots; pytest rejects the definition.",
      "fail_rate": 0.98,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "@pytest.fixture\ndef user(request):\n    return User(name=request.param)\n\n@pytest.mark.parametrize('user', ['alice', 'bob'], indirect=True)\ndef test_user(user):\n    ...",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "@pytest.mark.parametrize('x,y', [(1,2),(3,4)], indirect=['x'])\ndef test_xy(x, y):  # x goes through fixture, y is raw\n    ...",
      "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.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-19",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}