Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pytest support for asyncio.

License

NotificationsYou must be signed in to change notification settings

seifertm/pytest-asyncio

 
 

Repository files navigation

Supported Python versionsMatrix chat room: #pytest-asyncio

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.

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 withtox, please ensurethe coverage at least stays the same before you submit a pull request.

About

Pytest support for asyncio.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python99.6%
  • Makefile0.4%

[8]ページ先頭

©2009-2025 Movatter.jp