python config_error ai_generated true

PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo? You can register it with markers option

ID: python/pytest-marker-unknown

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
0Evidence
2024-12-20First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active
3.9 active
3.10 active
3.11 active
3.12 active

Root Cause

A custom marker is used in tests but not registered in pytest configuration, causing a warning during collection.

generic

中文

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

Workarounds

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

Dead Ends

Common approaches that don't work:

  1. 80% fail

    This removes useful metadata for test selection and organization.

  2. 60% fail

    The warning may escalate to an error in future pytest versions, and it hides potential typos.