python
config_error
ai_generated
true
UsageError: provided markers not found in collection: ['slow']
ID: python/pytest-marker-expression-error
80%Fix Rate
87%Confidence
0Evidence
2024-02-14First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 7.4.0 | active | — | — | — |
Root Cause
使用 -m 参数指定标记,但测试中没有定义该标记
generic中文
使用 -m 参数指定标记,但测试中没有定义该标记
Workarounds
-
95% success
在 pytest.ini 中添加 markers = slow: 慢速测试
-
80% success
pytest --markers 列出所有可用标记
Dead Ends
Common approaches that don't work:
-
30% fail
如果标记未注册,pytest 仍会警告
-
90% fail
导致没有测试运行