{
  "id": "python/pytest-conftest-recursion-error",
  "signature": "RecursionError: maximum recursion depth exceeded while calling a Python object in conftest.py",
  "signature_zh": "递归错误：在 conftest.py 中调用 Python 对象时超出最大递归深度",
  "regex": "RecursionError:\\ maximum\\ recursion\\ depth\\ exceeded\\ while\\ calling\\ a\\ Python\\ object\\ in\\ conftest\\.py",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A fixture in conftest.py is calling itself recursively without a base case, often due to circular dependency or infinite loop in fixture setup.",
  "root_cause_type": "generic",
  "root_cause_zh": "conftest.py 中的夹具在没有基本情况的情况下递归调用自身，通常是由于循环依赖或夹具设置中的无限循环。",
  "versions": [
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increasing recursion limit with sys.setrecursionlimit",
      "why_fails": "This only delays the crash; the infinite loop still exists and may exhaust memory.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing all fixtures from conftest.py",
      "why_fails": "Tests that depend on those fixtures will fail with missing fixture errors.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Identify and break the circular dependency by restructuring fixtures.",
      "success_rate": 0.85,
      "how": "Refactor conftest.py to avoid fixture A calling fixture B that calls fixture A again.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use 'yield' fixtures with proper teardown to avoid recursive setup.",
      "success_rate": 0.8,
      "how": "Change fixture to use yield instead of return to ensure cleanup breaks recursion.",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-09-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}