python config_error ai_generated true

PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?

ID: python/pytest-markers-unknown

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
0Evidence
2025-04-18First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active

Root Cause

使用了未注册的pytest标记,导致警告,可能影响测试筛选。

generic

中文

pytest标记未在配置中注册,导致警告。

Workarounds

  1. 100% success
    [pytest]
    markers =
        slow: marks tests as slow
  2. 95% success
    def pytest_configure(config):
        config.addinivalue_line('markers', 'slow: slow tests')

Dead Ends

Common approaches that don't work:

  1. 60% fail

    可能导致标记不生效,测试筛选失败。

  2. 70% fail

    可能移除需要的测试分类。