# 类型错误：skip() 缺少必需的位置参数：'reason'

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

## 根因

使用 @unittest.skip 时未提供原因字符串，或将其作为无括号的裸装饰器使用，导致 TypeError。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   Use @unittest.skip('reason') with a string argument, e.g., @unittest.skip('Not implemented yet')
   ```
2. **** (90% 成功率)
   ```
   Alternatively, use @unittest.skipIf(condition, 'reason') to skip conditionally.
   ```

## 无效尝试

- **** — Adding parentheses but no argument (e.g., @unittest.skip()) still fails because reason is required. (70% 失败率)
- **** — Using @unittest.skipIf(condition) without a reason also fails because reason is required for skipIf. (60% 失败率)
