{
  "id": "python/unittest-test-discovery-failure",
  "signature": "Ran 0 tests in 0.000s\n\nNO TESTS RAN",
  "signature_zh": "运行了 0 个测试，耗时 0.000 秒\n\n未运行任何测试",
  "regex": "Ran\\ 0\\ tests\\ in\\ 0\\.000s\\\n\\\nNO\\ TESTS\\ RAN",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "unittest did not discover any tests, often because the test files are not named test_*.py or the test classes do not inherit from unittest.TestCase.",
  "root_cause_type": "generic",
  "root_cause_zh": "unittest 未发现任何测试，通常是因为测试文件未命名为 test_*.py 或测试类未继承自 unittest.TestCase。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "unittest discovery relies on the test_*.py pattern; renaming may break discovery further.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This may run tests if the file has a if __name__ == '__main__' block, but does not fix discovery for all tests.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Rename files to test_*.py and make test classes subclass unittest.TestCase. Use python -m unittest discover -s tests -p 'test_*.py'",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "python -m unittest tests.test_module",
      "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": "2025-05-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}