{
  "id": "python/pytest-marker-filter-error",
  "signature": "pytest.PytestUsageError: Unknown marker 'slow' - maybe you meant 'slow_test'?",
  "signature_zh": "pytest 使用错误：未知标记 'slow' - 也许你的意思是 'slow_test'？",
  "regex": "pytest\\.PytestUsageError:\\ Unknown\\ marker\\ 'slow'\\ \\-\\ maybe\\ you\\ meant\\ 'slow_test'\\?",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A test uses a custom marker (e.g., @pytest.mark.slow) that is not registered in pytest.ini or conftest.py, causing pytest to raise an error when filtering or running tests with that marker.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试使用了未在 pytest.ini 或 conftest.py 中注册的自定义标记（如 @pytest.mark.slow），导致 pytest 在过滤或运行带有该标记的测试时引发错误。",
  "versions": [
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Ignoring the marker and running all tests without filtering may work but defeats the purpose of selective test execution.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using a similar built-in marker like @pytest.mark.skip may not achieve the desired filtering behavior.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Register the marker in pytest.ini: [pytest] markers = slow: marks tests as slow, or in conftest.py: def pytest_configure(config): config.addinivalue_line('markers', 'slow: marks tests as slow')",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.7,
      "how": "Use the marker without filtering by running pytest with -k 'not slow' to skip unregistered markers, but registration is recommended.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2026-01-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}