# PytestUnknownMarkWarning: 未知的 pytest.mark.slow - 是否有处理它的插件？

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

## 根因

使用了自定义标记（如 @pytest.mark.slow），但未在 pytest 配置中注册。pytest 会发出警告，并在 --strict-markers 下可能将其视为无效。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 7.x | active | — | — |
| 8.x | active | — | — |

## 解决方案

1. **** (96% 成功率)
   ```
   # pytest.ini
[pytest]
markers =
    slow: marks tests as slow
    integration: marks integration tests
   ```
2. **** (94% 成功率)
   ```
   [tool.pytest.ini_options]
markers = [
  "slow: marks tests as slow",
  "integration: marks integration tests",
]
   ```

## 无效尝试

- **** — Suppresses the warning but the marker still has no registered meaning; with --strict-markers the suite still fails. (70% 失败率)
- **** — Changes test selection semantics; tests intended to run now get skipped. (80% 失败率)
