{
  "id": "python/pytest-conftest-import-error",
  "signature": "ImportError: cannot import name 'my_helper' from 'conftest' (unknown location)",
  "signature_zh": "ImportError: 无法从 'conftest' 导入名称 'my_helper' (未知位置)",
  "regex": "ImportError:\\ cannot\\ import\\ name\\ 'my_helper'\\ from\\ 'conftest'\\ \\(unknown\\ location\\)",
  "domain": "python",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "A conftest.py file tries to import a function or variable that is not defined in it, often due to a circular import or missing definition.",
  "root_cause_type": "generic",
  "root_cause_zh": "conftest.py 文件尝试导入一个未在其中定义的函数或变量，通常是由于循环导入或缺少定义。",
  "versions": [
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "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"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The issue is not import order but the missing symbol; moving it does not help.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This changes the intended behavior and may cause other tests to fail.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Define the missing function in conftest.py or import it from a separate module: `from my_helpers import my_helper`",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Check for circular imports by restructuring the code to avoid conftest importing itself.",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-04-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}