{
  "id": "python/unittest-skipif-condition-false",
  "signature": "unittest.case.SkipTest: SkipTest raised in test_skip_if_condition",
  "signature_zh": "unittest.case.SkipTest: 在 test_skip_if_condition 中引发 SkipTest",
  "regex": "unittest\\.case\\.SkipTest:\\ SkipTest\\ raised\\ in\\ test_skip_if_condition",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The @unittest.skipIf decorator condition evaluated to True, causing the test to be skipped intentionally. This is expected behavior, but may be surprising if the condition is misconfigured.",
  "root_cause_type": "generic",
  "root_cause_zh": "@unittest.skipIf装饰器条件评估为True，导致测试被有意跳过。这是预期行为，但如果条件配置错误，可能会令人惊讶。",
  "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": "Removing the skipIf decorator entirely",
      "why_fails": "This runs the test unconditionally, which may fail if the condition was meant to avoid an incompatible environment.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Changing the condition to always be False",
      "why_fails": "This defeats the purpose of conditional skipping and may cause tests to run in unsupported environments.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Verify the condition logic in the skipIf decorator",
      "success_rate": 0.9,
      "how": "Check the condition: @unittest.skipIf(sys.platform == 'win32', 'Not supported on Windows')\nIf the test should run on Windows, change the condition or use skipUnless.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use skipIf with a more precise condition or use skip for unconditional skip",
      "success_rate": 0.85,
      "how": "@unittest.skipIf(not hasattr(os, 'symlink'), 'No symlink support')\nThis skips only if the platform lacks symlink support.",
      "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.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-03-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}