{
  "id": "python/pytest-conftest-not-loaded",
  "signature": "fixture 'my_fixture' not found",
  "signature_zh": "未找到夹具 'my_fixture'",
  "regex": "fixture\\ 'my_fixture'\\ not\\ found",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "pytest did not load the conftest.py file containing the fixture. This happens when conftest.py is in the wrong directory, not in the test path, or when rootdir is misconfigured.",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest 未加载包含夹具的 conftest.py 文件。这发生在 conftest.py 位于错误目录、不在测试路径中，或 rootdir 配置错误时。",
  "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": "This duplicates the fixture across multiple test files and defeats the purpose of conftest.py for sharing fixtures.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "pytest does not load fixtures from __init__.py. Only conftest.py files are automatically loaded.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "# Place conftest.py in the tests/ directory or project root\n# pytest automatically loads conftest.py from rootdir and test directories",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "pytest --confcutdir=tests/",
      "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.89,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}