Skip to main content

pytest-asyncio

https://img.shields.io/pypi/v/pytest-asyncio.svg https://github.com/pytest-dev/pytest-asyncio/workflows/CI/badge.svg https://codecov.io/gh/pytest-dev/pytest-asyncio/branch/main/graph/badge.svg Supported Python versions Matrix chat room: #pytest-asyncio

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.

Metadata

Release files for pytest-asyncio 0.23.5.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-asyncio 0.23.5.post1
File Size Uploaded
pytest-asyncio-0.23.5.post1.tar.gz 46.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-asyncio 0.23.5.post1
File Interpreter ABI Platform
pytest_asyncio-0.23.5.post1-py3-none-any.whl Python 3 none any Details

Total release size: 63.9 kB

Release files / pytest-asyncio-0.23.5.post1.tar.gz

Download URL pytest-asyncio-0.23.5.post1.tar.gz
Size 46.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b9a8806bea78c21276bc34321bbf234ba1b2ea5b30d9f0ce0f2dea45e4685813
BLAKE2b-256 checksum
How to use checksums
7498acc4cf65e9296c0b03fd166df2e7018991a379d9a0fe8cabf8fc0b9ead29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / pytest_asyncio-0.23.5.post1-py3-none-any.whl

Download URL pytest_asyncio-0.23.5.post1-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30f54d27774e79ac409778889880242b0403d09cabd65b727ce90fe92dd5d80e
BLAKE2b-256 checksum
How to use checksums
16a64b561db5e5ed2c928288b32d2c30265c4e6453bb172de926579c2bd979f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release history Release notifications | RSS feed

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.26.0

2 release files

0.25.3

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.8

2 release files

0.23.7

2 release files

0.23.6

2 release files

This release

0.23.5.post1 This release

2 release files

0.23.4

2 release files

0.22.0

2 release files

0.21.2

2 release files

0.21.1

2 release files

0.21.0

2 release files

0.20.2

2 release files

0.20.1

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.3

3 release files

0.18.1

2 release files

0.17.2

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.12.0

1 release file

0.11.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page