File: parametrize_with_asyncio.rst

package info (click to toggle)
python-pytest-asyncio 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 648 kB
  • sloc: python: 2,933; makefile: 24; sh: 1
file content (11 lines) | stat: -rw-r--r-- 629 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
=====================================
How to parametrize asynchronous tests
=====================================

The ``pytest.mark.parametrize`` marker works with asynchronous tests the same as with synchronous tests. You can apply both ``pytest.mark.asyncio`` and ``pytest.mark.parametrize`` to asynchronous test functions:

.. include:: parametrize_with_asyncio_example.py
    :code: python

.. note::
   Whilst asynchronous tests can be parametrized, each individual test case still runs sequentially, not concurrently. For more information about how pytest-asyncio executes tests, see :ref:`concepts/concurrent_execution`.