{
  "id": "python/pytest-mark-async-without-plugin",
  "signature": "PytestUnknownMarkWarning: Unknown pytest.mark.asyncio - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html",
  "signature_zh": "PytestUnknownMarkWarning: 未知的 pytest.mark.asyncio - 是否拼写错误？可以注册自定义标记以避免此警告 - 详情见 https://docs.pytest.org/en/stable/how-to/mark.html",
  "regex": "PytestUnknownMarkWarning:\\ Unknown\\ pytest\\.mark\\.asyncio\\ \\-\\ is\\ this\\ a\\ typo\\?\\ \\ You\\ can\\ register\\ custom\\ marks\\ to\\ avoid\\ this\\ warning\\ \\-\\ for\\ details,\\ see\\ https://docs\\.pytest\\.org/en/stable/how\\-to/mark\\.html",
  "domain": "python",
  "category": "install_error",
  "subcategory": null,
  "root_cause": "The async test is marked with @pytest.mark.asyncio but pytest-asyncio is not installed or not enabled, so the coroutine is never awaited and the test passes without running.",
  "root_cause_type": "generic",
  "root_cause_zh": "异步测试标记了 @pytest.mark.asyncio，但未安装或未启用 pytest-asyncio，导致协程从未被 await，测试未执行却通过。",
  "versions": [
    {
      "version": "0.21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "0.23",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The coroutine still is not awaited; the test silently passes without executing assertions.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Duplicate marks do nothing; the plugin is still missing.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.98,
      "how": "pip install pytest-asyncio\n# pytest.ini\n# [pytest]\n# asyncio_mode = auto",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "# pytest.ini\n# [pytest]\n# markers =\n#   asyncio: mark test as async\n# filterwarnings =\n#   error::pytest.PytestUnknownMarkWarning",
      "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-06-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}