{
  "id": "python/unittest-skip-decorator-error",
  "signature": "TypeError: skip() takes exactly 1 argument (0 given)",
  "signature_zh": "类型错误：skip()函数需要1个参数，但给了0个",
  "regex": "TypeError:\\ skip\\(\\)\\ takes\\ exactly\\ 1\\ argument\\ \\(0\\ given\\)",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "在unittest中，@unittest.skip装饰器必须提供一个原因字符串，如果省略则报错。",
  "root_cause_type": "generic",
  "root_cause_zh": "在unittest中，@unittest.skip装饰器必须提供一个原因字符串，如果省略则报错。",
  "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"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "skipIf也需要条件参数，不是无参数跳过",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "删除装饰器会导致测试执行，而不是跳过",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 1.0,
      "how": "@unittest.skip('暂时跳过')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "def test_foo(self):\n    self.skipTest('原因')",
      "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.9,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}