{
  "id": "python/pytest-mark-skipif-condition-error",
  "signature": "TypeError: skipif() got an unexpected keyword argument 'condition'",
  "signature_zh": "类型错误：skipif() 收到意外的关键字参数 'condition'",
  "regex": "TypeError:\\ skipif\\(\\)\\ got\\ an\\ unexpected\\ keyword\\ argument\\ 'condition'",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "错误地使用了 pytest.mark.skipif，将其作为函数调用而非装饰器。",
  "root_cause_type": "generic",
  "root_cause_zh": "错误地使用了 pytest.mark.skipif，将其作为函数调用而非装饰器。",
  "versions": [
    {
      "version": "7.4.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "skipif 需要条件表达式，移除后无法判断是否跳过。",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "skip 是无条件的，不符合需求。",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 1.0,
      "how": "`@pytest.mark.skipif(sys.version_info < (3, 8), reason='需要 Python 3.8+')`",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "在测试函数内 `pytest.skip('原因')` 根据条件跳过。",
      "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.9,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-05-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}