{
  "id": "python/unittest-testloader-syntax-error",
  "signature": "SyntaxError: invalid syntax in test file loaded by unittest.TestLoader",
  "signature_zh": "语法错误：由 unittest.TestLoader 加载的测试文件中存在无效语法",
  "regex": "SyntaxError:\\ invalid\\ syntax\\ in\\ test\\ file\\ loaded\\ by\\ unittest\\.TestLoader",
  "domain": "python",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The test file contains Python syntax errors (e.g., missing colon, unmatched parentheses) that prevent it from being parsed.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试文件包含 Python 语法错误（例如缺少冒号、括号不匹配），导致无法解析。",
  "versions": [
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Running only specific tests without fixing syntax errors in the file",
      "why_fails": "TestLoader imports the entire module; syntax errors prevent any test from running.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding try-except blocks around test code to handle syntax errors",
      "why_fails": "Syntax errors occur at compile time, not runtime; try-except cannot catch them.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check the test file for syntax errors using Python's compile function or a linter.",
      "success_rate": 0.9,
      "how": "Run 'python -m py_compile test_file.py' to identify syntax errors.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a code formatter like black to automatically fix syntax issues.",
      "success_rate": 0.8,
      "how": "black test_file.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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}