{"library":"pytest-anyio","title":"pytest-anyio (DEPRECATED: Plugin built into anyio)","description":"This package is obsolete. The pytest plugin for AnyIO is built directly into the `anyio` library itself, meaning `pytest-anyio` does not need to be installed. The PyPI entry for `pytest-anyio` serves primarily as a redirect to this information. AnyIO provides a robust asynchronous networking and concurrency library compatible with asyncio and Trio, with its pytest plugin facilitating asynchronous test writing and fixture management.","language":"python","status":"deprecated","last_verified":"Sun May 17","install":{"commands":["pip install anyio pytest"],"cli":null},"imports":["import pytest\n# ... then use @pytest.mark.anyio on async test functions or pytestmark = pytest.mark.anyio","def test_my_async_function(anyio_backend): ..."],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pytest\nimport anyio\n\n# Option 1: Mark individual async test functions\n@pytest.mark.anyio\nasync def test_async_function():\n    await anyio.sleep(0.001)\n    assert True\n\n# Option 2: Mark all async test functions in a module\npytestmark = pytest.mark.anyio\n\nasync def test_another_async_function_module_wide():\n    await anyio.sleep(0.001)\n    assert True\n\n# Option 3: Use the anyio_backend fixture (often implicitly, or for custom backend control)\nasync def test_with_anyio_backend_fixture(anyio_backend):\n    # 'anyio_backend' can be used to explicitly specify a backend or is implicitly available\n    # For example, to run only on 'asyncio':\n    # @pytest.mark.parametrize('anyio_backend', ['asyncio'])\n    # async def test_on_asyncio_only(anyio_backend):\n    await anyio.sleep(0.001)\n    assert True\n\n# Example of an asynchronous fixture\n@pytest.fixture\n@pytest.mark.anyio\nasync def async_data():\n    # Simulate async setup\n    await anyio.sleep(0.001)\n    yield {'key': 'value'}\n    # Simulate async teardown\n    await anyio.sleep(0.001)\n\nasync def test_using_async_fixture(async_data):\n    assert async_data['key'] == 'value'","lang":"python","description":"To write asynchronous tests with AnyIO and pytest, ensure `anyio` and `pytest` are installed. You can mark individual asynchronous test functions with `@pytest.mark.anyio`, apply `pytestmark = pytest.mark.anyio` at the module level to mark all tests, or configure `anyio_mode = 'auto'` in your `pytest.ini`. The `anyio_backend` fixture is automatically available for managing async backends. Asynchronous fixtures are also fully supported by marking them with `@pytest.fixture` and `@pytest.mark.anyio`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":null,"pypi_latest":"0.0.0","is_stale":null,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":2.9,"avg_import_s":0.44,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"anyio","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.42,"mem_mb":12.2,"disk_size":"82.9M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"anyio","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.8,"import_time_s":0.29,"mem_mb":12.2,"disk_size":"154M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"anyio","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.56,"mem_mb":12.9,"disk_size":"90.9M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"anyio","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.8,"import_time_s":0.53,"mem_mb":12.9,"disk_size":"162M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"anyio","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.52,"mem_mb":12.8,"disk_size":"81.1M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"anyio","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.7,"import_time_s":0.49,"mem_mb":12.8,"disk_size":"152M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"anyio","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.48,"mem_mb":11.8,"disk_size":"77.3M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"anyio","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.7,"import_time_s":0.42,"mem_mb":11.8,"disk_size":"151M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"anyio","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.38,"mem_mb":11.2,"disk_size":"81.7M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"anyio","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.3,"import_time_s":0.31,"mem_mb":11.2,"disk_size":"153M"}]}}