Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
.. image:: https://img.shields.io/pypi/v/pytest-asyncio.svg :target: https://pypi.python.org/pypi/pytest-asyncio .. image:: https://github.com/pytest-dev/pytest-asyncio/workflows/CI/badge.svg :target: https://github.com/pytest-dev/pytest-asyncio/actions?workflow=CI .. image:: https://codecov.io/gh/pytest-dev/pytest-asyncio/branch/main/graph/badge.svg :target: https://codecov.io/gh/pytest-dev/pytest-asyncio .. image:: https://img.shields.io/pypi/pyversions/pytest-asyncio.svg :target: https://github.com/pytest-dev/pytest-asyncio :alt: Supported Python versions .. image:: https://img.shields.io/badge/Matrix-%23pytest--asyncio-brightgreen :alt: Matrix chat room: #pytest-asyncio :target: https://matrix.to/#/#pytest-asyncio:matrix.org
pytest-asyncio <https://pytest-asyncio.readthedocs.io/en/latest/>
_ is a pytest <https://docs.pytest.org/en/latest/contents.html>
_ plugin. It facilitates testing of code that uses the asyncio <https://docs.python.org/3/library/asyncio.html>
_ 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:
.. code-block:: python
@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 <https://pytest-asyncio.readthedocs.io/en/latest/>
_.
Note that test classes subclassing the standard unittest <https://docs.python.org/3/library/unittest.html>
__ library are not supported. Users
are advised to use unittest.IsolatedAsyncioTestCase <https://docs.python.org/3/library/unittest.html#unittest.IsolatedAsyncioTestCase>
__
or an async framework such as asynctest <https://asynctest.readthedocs.io/en/latest>
__.
pytest-asyncio is available under the Apache License 2.0 <https://github.com/pytest-dev/pytest-asyncio/blob/main/LICENSE>
_.
To install pytest-asyncio, simply:
.. code-block:: bash
$ 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.
FAQs
Pytest support for asyncio
We found that pytest-asyncio demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.