{
  "id": "python/unittest-testloader-discover-empty",
  "signature": "unittest.suite.TestSuite: No tests found in 'tests/' directory",
  "signature_zh": "unittest.suite.TestSuite: 在 'tests/' 目录中未找到任何测试",
  "regex": "unittest\\.suite\\.TestSuite:\\ No\\ tests\\ found\\ in\\ 'tests/'\\ directory",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The unittest test discovery process did not find any test files matching the default pattern (test*.py) in the specified directory, possibly because test files are named differently or the directory path is incorrect.",
  "root_cause_type": "generic",
  "root_cause_zh": "unittest测试发现过程在指定目录中未找到任何匹配默认模式（test*.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"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Renaming all test files to start with 'test_' without checking the pattern",
      "why_fails": "This may work but ignores the possibility of custom patterns or incorrect directory paths.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Running tests with a different command like `python -m pytest tests/` without adjusting unittest settings",
      "why_fails": "This switches to pytest, which may not be the intended framework and could require separate configuration.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Specify a custom test discovery pattern using the -p option",
      "success_rate": 0.9,
      "how": "python -m unittest discover -s tests/ -p '*_test.py'\nThis will find files ending with '_test.py'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Ensure the test directory path is correct and test files follow the default pattern",
      "success_rate": 0.85,
      "how": "Check that tests/ exists and contains files like test_example.py. If not, move or rename files accordingly.\nAlternatively, use: python -m unittest discover -s ./tests",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}