{
  "id": "python/pytest-asyncio-no-plugin",
  "signature": "async def functions are not natively supported.\nYou need to install a suitable plugin for your async framework, for example:\n  - anyio\n  - pytest-asyncio\n  - pytest-tornasync\n  - pytest-trio\n  - pytest-twisted",
  "signature_zh": "async def 函数不被原生支持。\n你需要为异步框架安装合适的插件，例如：\n  - anyio\n  - pytest-asyncio\n  - pytest-tornasync\n  - pytest-trio\n  - pytest-twisted",
  "regex": "async\\ def\\ functions\\ are\\ not\\ natively\\ supported\\.\\\nYou\\ need\\ to\\ install\\ a\\ suitable\\ plugin\\ for\\ your\\ async\\ framework,\\ for\\ example:\\\n\\ \\ \\-\\ anyio\\\n\\ \\ \\-\\ pytest\\-asyncio\\\n\\ \\ \\-\\ pytest\\-tornasync\\\n\\ \\ \\-\\ pytest\\-trio\\\n\\ \\ \\-\\ pytest\\-twisted",
  "domain": "python",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "pytest does not natively run async test functions. Without pytest-asyncio (or another async plugin) and the correct asyncio_mode configuration, async tests are skipped/failed with this message.",
  "root_cause_type": "generic",
  "root_cause_zh": "pytest 不原生支持运行 async 测试函数。未安装 pytest-asyncio（或其他异步插件）且未配置 asyncio_mode 时，异步测试会报此错。",
  "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": "Runs at import time, not collection time, and breaks fixtures/event loop reuse.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The marker is unknown without the plugin; test still fails with the same message.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "pip install pytest-asyncio, then add to pyproject.toml or pytest.ini:\n[tool.pytest.ini_options]\nasyncio_mode = \"auto\"\n\nand mark tests with @pytest.mark.asyncio (or rely on auto mode).",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "Alternatively use anyio: `pip install anyio` and decorate with `@pytest.mark.anyio`.",
      "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-05-08",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}