pytest-asyncio is a pytest plugin. It facilitates testing of code that uses the asyncio library.
Specifically, pytest-asyncio provides support for coroutines as test functions. This allows users to await code inside their tests. For example, the following code is executed as a test item by pytest:
@pytest.mark.asyncio
async def test_some_asyncio_code():
res = await library.do_something()
assert b"expected result" == res
More details can be found in the documentation.
Note that test classes subclassing the standard unittest library are not supported. Users are advised to use unittest.IsolatedAsyncioTestCase or an async framework such as asynctest.
pytest-asyncio is available under the Apache License 2.0.
Installation
To install pytest-asyncio, simply:
$ pip install pytest-asyncio
This is enough for pytest to pick up pytest-asyncio.
Contributing
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
Release files for pytest-asyncio 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_asyncio-1.4.0.tar.gz | 58.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_asyncio-1.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 75.4 kB
Release files / pytest_asyncio-1.4.0.tar.gz
| Download URL | pytest_asyncio-1.4.0.tar.gz |
|---|---|
| Size | 58.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6c0d2259945122819f171a32ecea2c349ead889ee28176caaf492143424be42
|
|
BLAKE2b-256 checksum How to use checksums |
437cd36d04db312ecf4298932ef77e6e4a9e8ad017906e24e34f0b0c361a2473
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 26, 2026.
Transparency logRelease files / pytest_asyncio-1.4.0-py3-none-any.whl
| Download URL | pytest_asyncio-1.4.0-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
933ca923a23075a87fb7070c0ec272a6848489824d887c85c812670932835aa1
|
|
BLAKE2b-256 checksum How to use checksums |
03e208a497ef684b88559c9cc5f4ad53a37e7b99e727094a86d6ea32536d5d3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 26, 2026.
Transparency log