# PytestUnknownMarkWarning: 未知的 pytest.mark.slow - 是拼写错误吗？你可以使用 markers 选项注册它

- **ID:** `python/pytest-marker-unknown`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

测试中使用了自定义标记，但未在 pytest 配置中注册，导致收集期间出现警告。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   Register the marker in pytest.ini: `[pytest]
markers =
    slow: marks tests as slow`
   ```
2. **** (90% 成功率)
   ```
   Use `pytest --markers` to list all registered markers and ensure the custom one is defined.
   ```

## 无效尝试

- **** — This removes useful metadata for test selection and organization. (80% 失败率)
- **** — The warning may escalate to an error in future pytest versions, and it hides potential typos. (60% 失败率)
