File: change_fixture_loop.rst

package info (click to toggle)
python-pytest-asyncio 0.25.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 656 kB
  • sloc: python: 3,108; makefile: 26; sh: 1
file content (7 lines) | stat: -rw-r--r-- 436 bytes parent folder | download
1
2
3
4
5
6
7
===============================================
How to change the event loop scope of a fixture
===============================================
The event loop scope of an asynchronous fixture is specified via the *loop_scope* keyword argument to :ref:`pytest_asyncio.fixture <decorators/pytest_asyncio_fixture>`. The following fixture runs in the module-scoped event loop:

.. include:: change_fixture_loop_example.py
    :code: python