{
  "id": "python/unittest-testcase-no-tests-ran",
  "signature": "Ran 0 tests in 0.000s\n\nNO TESTS RAN",
  "signature_zh": "Ran 0 tests in 0.000s\n\nNO TESTS RAN",
  "regex": "Ran\\ 0\\ tests\\ in\\ 0\\.000s\\\n\\\nNO\\ TESTS\\ RAN",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "unittest discovers zero tests because test methods do not start with 'test', the TestCase subclass name does not start with 'Test', or discovery was pointed at the wrong directory/pattern.",
  "root_cause_type": "generic",
  "root_cause_zh": "unittest 发现零个测试，因为测试方法不以 'test' 开头、TestCase 子类名不以 'Test' 开头，或发现路径/模式指向了错误的目录。",
  "versions": [
    {
      "version": "3.8",
      "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": "More verbose output still reports zero tests; the naming problem is unchanged.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "File naming is necessary but not sufficient; methods must also start with 'test'.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "import unittest\n\nclass TestMath(unittest.TestCase):\n    def test_add(self):\n        self.assertEqual(1 + 1, 2)\n\nif __name__ == '__main__':\n    unittest.main()",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "python -m unittest discover -s tests -p 'test_*.py' -v",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-19",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}