METADATA 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. Metadata-Version: 2.4
  2. Name: pytest-asyncio
  3. Version: 1.3.0
  4. Summary: Pytest support for asyncio
  5. Author-email: Tin Tvrtković <tinchester@gmail.com>
  6. Maintainer-email: Michael Seifert <m.seifert@digitalernachschub.de>
  7. License-Expression: Apache-2.0
  8. Project-URL: Bug Tracker, https://github.com/pytest-dev/pytest-asyncio/issues
  9. Project-URL: Changelog, https://pytest-asyncio.readthedocs.io/en/latest/reference/changelog.html
  10. Project-URL: Documentation, https://pytest-asyncio.readthedocs.io
  11. Project-URL: Homepage, https://github.com/pytest-dev/pytest-asyncio
  12. Project-URL: Source Code, https://github.com/pytest-dev/pytest-asyncio
  13. Classifier: Development Status :: 5 - Production/Stable
  14. Classifier: Framework :: AsyncIO
  15. Classifier: Framework :: Pytest
  16. Classifier: Intended Audience :: Developers
  17. Classifier: Programming Language :: Python :: 3 :: Only
  18. Classifier: Programming Language :: Python :: 3.10
  19. Classifier: Programming Language :: Python :: 3.11
  20. Classifier: Programming Language :: Python :: 3.12
  21. Classifier: Programming Language :: Python :: 3.13
  22. Classifier: Programming Language :: Python :: 3.14
  23. Classifier: Topic :: Software Development :: Testing
  24. Classifier: Typing :: Typed
  25. Requires-Python: >=3.10
  26. Description-Content-Type: text/x-rst
  27. License-File: LICENSE
  28. Requires-Dist: backports-asyncio-runner<2,>=1.1; python_version < "3.11"
  29. Requires-Dist: pytest<10,>=8.2
  30. Requires-Dist: typing-extensions>=4.12; python_version < "3.13"
  31. Provides-Extra: docs
  32. Requires-Dist: sphinx>=5.3; extra == "docs"
  33. Requires-Dist: sphinx-rtd-theme>=1; extra == "docs"
  34. Provides-Extra: testing
  35. Requires-Dist: coverage>=6.2; extra == "testing"
  36. Requires-Dist: hypothesis>=5.7.1; extra == "testing"
  37. Dynamic: license-file
  38. pytest-asyncio
  39. ==============
  40. .. image:: https://img.shields.io/pypi/v/pytest-asyncio.svg
  41. :target: https://pypi.python.org/pypi/pytest-asyncio
  42. .. image:: https://github.com/pytest-dev/pytest-asyncio/workflows/CI/badge.svg
  43. :target: https://github.com/pytest-dev/pytest-asyncio/actions?workflow=CI
  44. .. image:: https://codecov.io/gh/pytest-dev/pytest-asyncio/branch/main/graph/badge.svg
  45. :target: https://codecov.io/gh/pytest-dev/pytest-asyncio
  46. .. image:: https://img.shields.io/pypi/pyversions/pytest-asyncio.svg
  47. :target: https://github.com/pytest-dev/pytest-asyncio
  48. :alt: Supported Python versions
  49. .. image:: https://img.shields.io/badge/Matrix-%23pytest--asyncio-brightgreen
  50. :alt: Matrix chat room: #pytest-asyncio
  51. :target: https://matrix.to/#/#pytest-asyncio:matrix.org
  52. `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.
  53. 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:
  54. .. code-block:: python
  55. @pytest.mark.asyncio
  56. async def test_some_asyncio_code():
  57. res = await library.do_something()
  58. assert b"expected result" == res
  59. More details can be found in the `documentation <https://pytest-asyncio.readthedocs.io/en/latest/>`_.
  60. Note that test classes subclassing the standard `unittest <https://docs.python.org/3/library/unittest.html>`__ library are not supported. Users
  61. are advised to use `unittest.IsolatedAsyncioTestCase <https://docs.python.org/3/library/unittest.html#unittest.IsolatedAsyncioTestCase>`__
  62. or an async framework such as `asynctest <https://asynctest.readthedocs.io/en/latest>`__.
  63. pytest-asyncio is available under the `Apache License 2.0 <https://github.com/pytest-dev/pytest-asyncio/blob/main/LICENSE>`_.
  64. Installation
  65. ------------
  66. To install pytest-asyncio, simply:
  67. .. code-block:: bash
  68. $ pip install pytest-asyncio
  69. This is enough for pytest to pick up pytest-asyncio.
  70. Contributing
  71. ------------
  72. Contributions are very welcome. Tests can be run with ``tox``, please ensure
  73. the coverage at least stays the same before you submit a pull request.