{
  "id": "python/pytest-conftest-not-collected",
  "signature": "ERROR: file or directory not found: tests/conftest.py\n\nno tests ran in 0.001s",
  "signature_zh": "ERROR: 找不到文件或目录: tests/conftest.py\n\n0.001s 内未运行测试",
  "regex": "ERROR:\\ file\\ or\\ directory\\ not\\ found:\\ tests/conftest\\.py\\\n\\\nno\\ tests\\ ran\\ in\\ 0\\.001s",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "conftest.py is a configuration file, not a test module; pytest does not collect tests from it. Passing it explicitly on the command line produces this error.",
  "root_cause_type": "generic",
  "root_cause_zh": "conftest.py 是配置文件而非测试模块；pytest 不从其中收集测试。显式在命令行传入它会产生此错误。",
  "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": "Fixtures defined there are no longer auto-discovered by sibling tests; they break.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "pytest still ignores tests in conftest.py; behavior is undefined and confusing.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.97,
      "how": "Run the test directory or a specific test, not conftest.py:\npytest tests/\n# or\npytest tests/test_api.py::test_health",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "If you want to test fixture logic, move helpers to a module and import them:\n# tests/helpers.py\ndef make_client(): ...\n# tests/test_helpers.py\nfrom tests.helpers import make_client",
      "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-01-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}