- Notifications
You must be signed in to change notification settings - Fork176
pytest-dev/pytest-asyncio
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
pytest-asyncio is apytest plugin. It facilitates testing of code that uses theasyncio library.
Specifically, pytest-asyncio provides support for coroutines as test functions. This allows users toawait code inside their tests. For example, the following code is executed as a test item by pytest:
@pytest.mark.asyncioasyncdeftest_some_asyncio_code():res=awaitlibrary.do_something()assertb"expected result"==res
More details can be found in thedocumentation.
Note that test classes subclassing the standardunittest library are not supported. Usersare advised to useunittest.IsolatedAsyncioTestCaseor an async framework such asasynctest.
pytest-asyncio is available under theApache 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 withtox, please ensurethe coverage at least stays the same before you submit a pull request.
About
Asyncio support for pytest
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.