# 类型错误：skip()函数需要1个参数，但给了0个

- **ID:** `python/unittest-skip-decorator-error`
- **领域:** python
- **类别:** type_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

在unittest中，@unittest.skip装饰器必须提供一个原因字符串，如果省略则报错。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |

## 解决方案

1. **** (100% 成功率)
   ```
   @unittest.skip('暂时跳过')
   ```
2. **** (95% 成功率)
   ```
   def test_foo(self):
    self.skipTest('原因')
   ```

## 无效尝试

- **** — skipIf也需要条件参数，不是无参数跳过 (60% 失败率)
- **** — 删除装饰器会导致测试执行，而不是跳过 (70% 失败率)
