experimental/sources/: pytest-asyncio-0.23.7 metadata and description

Homepage Simple index

Pytest support for asyncio

author Tin Tvrtković <tinchester@gmail.com>
author_email tinchester@gmail.com
  • Development Status :: 4 - Beta
  • Intended Audience :: Developers
  • License :: OSI Approved :: Apache Software License
  • Programming Language :: Python :: 3.8
  • Programming Language :: Python :: 3.9
  • Programming Language :: Python :: 3.10
  • Programming Language :: Python :: 3.11
  • Programming Language :: Python :: 3.12
  • Topic :: Software Development :: Testing
  • Framework :: AsyncIO
  • Framework :: Pytest
  • Typing :: Typed
description_content_type text/x-rst
license Apache 2.0
  • Documentation, https://pytest-asyncio.readthedocs.io
  • Changelog, https://pytest-asyncio.readthedocs.io/en/latest/reference/changelog.html
  • Source Code, https://github.com/pytest-dev/pytest-asyncio
  • Bug Tracker, https://github.com/pytest-dev/pytest-asyncio/issues
provides_extras docs
  • pytest<9,>=7.0.0
  • coverage>=6.2; extra == "testing"
  • hypothesis>=5.7.1; extra == "testing"
  • sphinx>=5.3; extra == "docs"
  • sphinx-rtd-theme>=1.0; extra == "docs"
requires_python >=3.8
File Tox results History
45 KB
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:

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.


To install pytest-asyncio, simply:

$ pip install pytest-asyncio

This is enough for pytest to pick up pytest-asyncio.


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.