pytest-asyncio
Pytest support for asyncio
Install
pytest-asyncio on PyPI
pip
pip install pytest-asynciouv
uv add pytest-asynciopoetry
poetry add pytest-asyncioPackage facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — backports-asyncio-runner, pytest, typing-extensions |
| Maintenance | actively maintained — 79 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: pytest_asyncio-1.4.0-py3-none-any.whl
About pytest-asyncio
from the package's own PyPI description — quoted content, verbatim
pytest-asyncio
.. image:: https://img.shields.io/pypi/v/pytest-asyncio.svg :target: https://pypi.python.org/pypi/pytest-asyncio .. image:: https://github.com/pytest-dev/pytest-asyncio/workflows/CI/badge.svg :target: https://github.com/pytest-dev/pytest-asyncio/actions?workflow=CI .. image:: https://codecov.io/gh/pytest-dev/pytest-asyncio/branch/main/graph/badge.svg :target: https://codecov.io/gh/pytest-dev/pytest-asyncio .. image:: https://img.shields.io/pypi/pyversions/pytest-asyncio.svg :target: https://github.com/pytest-dev/pytest-asyncio :alt: Supported Python versions .. image:: https://img.shields.io/badge/Matrix-%23pytest--asyncio-brightgreen :alt: Matrix chat room: #pytest-asyncio :target: https://matrix.to/#/#pytest-asyncio:matrix.org
pytest-asyncio <https://pytest-asyncio.readthedocs.io/en/stable/> is a pytest <https://docs.pytest.org/en/latest/contents.html> plugin. It facilitates testing of code that uses the asyncio <https://docs.python.org/3/library/asyncio.html>_ library.
Specifically, pytest-asyncio provides support for coroutines as test functions. This allows users to await code inside their tests. For...
Read as markdown · JSON record · Source repository · Homepage · Docs
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
pytest-asyncio is a pytest plugin that enables testing of asyncio-based code by allowing coroutines to be used directly as test functions with the @pytest.mark.asyncio decorator.
Low friction installation with a pure-Python wheel and minimal runtime dependencies (pytest, typing-extensions, backports-asyncio-runner). Active maintenance with recent releases and 1656 GitHub stars indicate solid community backing.
Apache-2.0 permissive license allows use in proprietary and open-source projects with minimal restrictions; attribution required.
Usage
pip install pytest-asyncio
import pytest
@pytest.mark.asyncio
async def test_example():
result = await some_async_function()
assert result == expected
Requires Python 3.10 or later; test classes subclassing unittest are not supported.
Verdict: pytest-asyncio is a mature, actively maintained plugin (1656 stars, last commit 2026-08-12) with zero known vulnerabilities, permissive licensing, and low install friction. It is well-suited for projects testing asyncio code and is in the top 1000 PyPI packages by popularity.
Needs verification
- Whether backports-asyncio-runner is required only on Python 3.10 or across all supported versions
- Performance characteristics when running large test suites with many concurrent async tests
Similar packages
permissive · top 100 on PyPI
aiohttppermissive · top 100 on PyPI
pytest-djangopermissive · top 1,000 on PyPI
greenletpermissive · top 100 on PyPI
pytest-timeoutpermissive · top 1,000 on PyPI
async-lrupermissive · top 1,000 on PyPI
frozenlistpermissive · top 100 on PyPI
multidictpermissive · top 100 on PyPI
propcachepermissive · top 100 on PyPI
yarlpermissive · top 100 on PyPI