From 9b8429f803217e4dcc2bb313af0c4f0b7634fb63 Mon Sep 17 00:00:00 2001 From: Tom Kuson Date: Wed, 30 Jul 2025 01:01:42 +0100 Subject: [PATCH] Document the asyncio debug option --- docs/reference/configuration.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/reference/configuration.rst b/docs/reference/configuration.rst index 81175549..7fef0af4 100644 --- a/docs/reference/configuration.rst +++ b/docs/reference/configuration.rst @@ -14,6 +14,29 @@ asyncio_default_test_loop_scope =============================== Determines the default event loop scope of asynchronous tests. When this configuration option is unset, it default to function scope. Possible values are: ``function``, ``class``, ``module``, ``package``, ``session`` +.. _configuration/asyncio_debug: + +asyncio_debug +============= +Enables `asyncio debug mode `_ for the default event loop used by asynchronous tests and fixtures. + +The debug mode can be set by the ``asyncio_debug`` configuration option in the `configuration file +`_: + +.. code-block:: ini + + # pytest.ini + [pytest] + asyncio_debug = true + +The value can also be set via the ``--asyncio-debug`` command-line option: + +.. code-block:: bash + + $ pytest tests --asyncio-debug + +By default, asyncio debug mode is disabled. + asyncio_mode ============ The pytest-asyncio mode can be set by the ``asyncio_mode`` configuration option in the `configuration file