{"id":24413,"library":"pytest-aio","title":"pytest-aio","description":"Pytest plugin for testing async Python code. Provides fixtures and markers for running async tests with pytest. Supports asyncio, trio, and other async frameworks. Current version 2.1.7, released under Apache 2.0 license. Active development, weekly commits.","status":"active","version":"2.1.7","language":"python","source_language":"en","source_url":"https://github.com/klen/pytest-aio","tags":["pytest","async","testing","plugin","asyncio"],"install":[{"cmd":"pip install pytest-aio","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Plugin requires pytest to work","package":"pytest","optional":false},{"reason":"Alternative, but pytest-aio is standalone","package":"pytest-asyncio","optional":true}],"imports":[{"note":"No common wrong pattern; plugin auto-loads via conftest","symbol":"pytest_aio","correct":"import pytest_aio"}],"quickstart":{"code":"# test_async.py\nimport pytest\n\n@pytest.mark.asyncio\nasync def test_async_example():\n    result = await some_async_function()\n    assert result == expected_value\n","lang":"python","description":"Basic async test using pytest-aio. Mark test with @pytest.mark.asyncio."},"warnings":[{"fix":"Upgrade to 2.x or mark async fixtures explicitly.","message":"pytest-aio does not automatically detect async fixtures. Use @pytest.fixture with asyncio marker or use async def fixture (requires pytest-aio>=2.0).","severity":"gotcha","affected_versions":"<2.0.0"},{"fix":"Remove marker and simply write 'async def test_async():'","message":"The @pytest.mark.asyncio marker is deprecated in pytest-aio 2.x; use 'async def' directly without marker.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Ensure Python >=3.10 and update tests to remove markers.","message":"Breaking change in 2.0: Removed support for Python <3.10. async fixtures now require pytest-aio 2.x.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'import asyncio' directly (stdlib), not from pytest_aio.","cause":"Trying to import asyncio from pytest_aio incorrectly.","error":"ImportError: cannot import name 'asyncio' from 'pytest_aio'"},{"fix":"Remove 'loop' argument; pytest-aio 2.x handles event loop automatically.","cause":"Old code passing loop fixture to async test.","error":"TypeError: async def test() got an unexpected keyword argument 'loop'"},{"fix":"Run 'pip install pytest-aio' in your environment.","cause":"pytest-aio not installed or not in virtual environment.","error":"ModuleNotFoundError: No module named 'pytest_aio'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}