{
  "id": "python/pytest-fixture-not-found-typo",
  "signature": "fixture 'db_session' not found\navailable fixtures: cache, capfd, ...",
  "signature_zh": "fixture 'db_session' 未找到\n可用 fixtures: cache, capfd, ...",
  "regex": "fixture\\ 'db_session'\\ not\\ found\\\navailable\\ fixtures:\\ cache,\\ capfd,\\ \\.\\.\\.",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Fixture name is misspelled, defined in a conftest.py outside the test's directory scope, or not imported because the plugin is not installed.",
  "root_cause_type": "generic",
  "root_cause_zh": "Fixture 名称拼写错误，定义在测试目录范围之外的 conftest.py 中，或者因插件未安装而未导入。",
  "versions": [
    {
      "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": "Duplicates fixture logic across many test files and defeats the purpose of shared fixtures.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Shadows a built-in pytest fixture and causes unexpected behavior in other tests.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Create `tests/conftest.py` with `@pytest.fixture\ndef db_session(): ...` and ensure tests are under `tests/`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "`pip install pytest-django` then in pytest.ini: `[pytest]\nDJANGO_SETTINGS_MODULE = myproj.settings`",
      "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.9,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-01-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}