{
  "id": "python/pytest-collection-zero-tests",
  "signature": "collected 0 items / 1 error\n\nERROR: found no collectors for /proj/tests/test_math.py::test_add",
  "signature_zh": "收集到 0 项 / 1 个错误\n\n错误：未找到 /proj/tests/test_math.py::test_add 的收集器",
  "regex": "collected\\ 0\\ items\\ /\\ 1\\ error\\\n\\\nERROR:\\ found\\ no\\ collectors\\ for\\ /proj/tests/test_math\\.py::test_add",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The test file or class does not match pytest's default discovery pattern (test_*.py / *_test.py, Test* class, test_* function), or a syntax/import error prevented collection.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试文件或类不匹配 pytest 的默认发现模式（test_*.py / *_test.py、Test* 类、test_* 函数），或语法/导入错误阻止了收集。",
  "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": "Cache provider has nothing to do with discovery patterns.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "There are no failures; there are no tests collected.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Coverage plugin doesn't affect collection rules.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "mv tests/math_test.py tests/test_math.py\n# class CheckMath -> class TestMath\n# def check_add -> def test_add",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "# pytest.ini\n[pytest]\npython_files = *_test.py test_*.py\npython_classes = Check* Test*\npython_functions = check_* test_*",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "pytest --collect-only -q -vv tests/test_math.py",
      "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-02-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}