METADATA 4.0 KB

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