{
  "id": "python/pytest-skip-marker-missing-reason",
  "signature": "PytestDeprecationWarning: pytest.mark.skip without reason is deprecated\n  @pytest.mark.skip\ndeprecated in pytest 7.0, will be an error in future versions",
  "signature_zh": "PytestDeprecationWarning: 不带 reason 的 pytest.mark.skip 已弃用\n  @pytest.mark.skip\n在 pytest 7.0 中弃用，未来版本将报错",
  "regex": "PytestDeprecationWarning:\\ pytest\\.mark\\.skip\\ without\\ reason\\ is\\ deprecated\\\n\\ \\ @pytest\\.mark\\.skip\\\ndeprecated\\ in\\ pytest\\ 7\\.0,\\ will\\ be\\ an\\ error\\ in\\ future\\ versions",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "`@pytest.mark.skip` and `@pytest.mark.skipif` require a `reason=` keyword in modern pytest; omitting it triggers a deprecation warning that becomes an error under `-W error`.",
  "root_cause_type": "generic",
  "root_cause_zh": "现代 pytest 中 `@pytest.mark.skip` 和 `@pytest.mark.skipif` 需要 `reason=` 关键字；省略会触发弃用警告，在 `-W error` 下变成错误。",
  "versions": [
    {
      "version": "7.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Suppresses all deprecations, hiding real issues across the suite.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Changes semantics: xfail expects failure, skip does not run; tests may start passing and turn XPASS.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.97,
      "how": "Always pass a reason:\n@pytest.mark.skip(reason='requires GPU')\ndef test_cuda(): ...\n\n@pytest.mark.skipif(sys.platform == 'win32', reason='POSIX only')\ndef test_fork(): ...",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Or use `pytest.importorskip` for optional deps:\nnp = pytest.importorskip('numpy', reason='numpy not installed')",
      "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": "2024-02-02",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}