METADATA 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. Metadata-Version: 2.1
  2. Name: pytest-asyncio
  3. Version: 0.21.1
  4. Summary: Pytest support for asyncio
  5. Home-page: https://github.com/pytest-dev/pytest-asyncio
  6. Author: Tin Tvrtković <tinchester@gmail.com>
  7. Author-email: tinchester@gmail.com
  8. License: Apache 2.0
  9. Project-URL: Documentation, https://pytest-asyncio.readthedocs.io
  10. Project-URL: Changelog, https://pytest-asyncio.readthedocs.io/en/latest/reference/changelog.html
  11. Project-URL: Source Code, https://github.com/pytest-dev/pytest-asyncio
  12. Project-URL: Bug Tracker, https://github.com/pytest-dev/pytest-asyncio/issues
  13. Classifier: Development Status :: 4 - Beta
  14. Classifier: Intended Audience :: Developers
  15. Classifier: License :: OSI Approved :: Apache Software License
  16. Classifier: Programming Language :: Python :: 3.7
  17. Classifier: Programming Language :: Python :: 3.8
  18. Classifier: Programming Language :: Python :: 3.9
  19. Classifier: Programming Language :: Python :: 3.10
  20. Classifier: Programming Language :: Python :: 3.11
  21. Classifier: Topic :: Software Development :: Testing
  22. Classifier: Framework :: AsyncIO
  23. Classifier: Framework :: Pytest
  24. Classifier: Typing :: Typed
  25. Requires-Python: >=3.7
  26. Description-Content-Type: text/x-rst
  27. License-File: LICENSE
  28. Requires-Dist: pytest (>=7.0.0)
  29. Requires-Dist: typing-extensions (>=3.7.2) ; python_version < "3.8"
  30. Provides-Extra: docs
  31. Requires-Dist: sphinx (>=5.3) ; extra == 'docs'
  32. Requires-Dist: sphinx-rtd-theme (>=1.0) ; extra == 'docs'
  33. Provides-Extra: testing
  34. Requires-Dist: coverage (>=6.2) ; extra == 'testing'
  35. Requires-Dist: hypothesis (>=5.7.1) ; extra == 'testing'
  36. Requires-Dist: flaky (>=3.5.0) ; extra == 'testing'
  37. Requires-Dist: mypy (>=0.931) ; extra == 'testing'
  38. Requires-Dist: pytest-trio (>=0.7.0) ; extra == 'testing'
  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/code%20style-black-000000.svg
  51. :target: https://github.com/ambv/black
  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.