- Notifications
You must be signed in to change notification settings - Fork0
Pytest support for asyncio.
License
seifertm/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
Pytest support for asyncio.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Languages
- Python99.6%
- Makefile0.4%