python
config_error
ai_generated
true
PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?
ID: python/pytest-markers-unknown
80%Fix Rate
85%Confidence
0Evidence
2025-04-18First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
Root Cause
使用了未注册的pytest标记,导致警告,可能影响测试筛选。
generic中文
pytest标记未在配置中注册,导致警告。
Workarounds
-
100% success
[pytest] markers = slow: marks tests as slow -
95% success
def pytest_configure(config): config.addinivalue_line('markers', 'slow: slow tests')
Dead Ends
Common approaches that don't work:
-
60% fail
可能导致标记不生效,测试筛选失败。
-
70% fail
可能移除需要的测试分类。