Skip to content

touilleWoman/pytest-asyncio

This branch is 2 commits ahead of, 355 commits behind pytest-dev/pytest-asyncio:main.

Folders and files

NameName
Last commit message
Last commit date
Oct 31, 2023
Nov 30, 2023
Dec 2, 2023
Nov 27, 2023
Nov 30, 2023
Dec 22, 2022
Jan 11, 2022
Oct 13, 2023
Oct 31, 2023
Jan 9, 2022
Jan 20, 2023
Oct 24, 2023
Jul 12, 2023
Feb 3, 2022
Nov 30, 2023
Nov 12, 2023

Repository files navigation

pytest-asyncio

Supported Python versions

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.

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.4%
  • Makefile 0.6%