From e74a3997755fa88b52721e7a51eca390d5dd5cb0 Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Tue, 14 Jan 2025 17:36:49 +1100 Subject: [PATCH] docs: how to set asyncio mode When reading the docs, it wasn't clear to me how to set asyncio's mode and I had to rely on looking at the source code (or scouring `pytest --help`). I thought it would be nice to expand the docs to be more explicit in this regard. Signed-off-by: JP-Ellis --- docs/concepts.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/concepts.rst b/docs/concepts.rst index be8b775b..a25df036 100644 --- a/docs/concepts.rst +++ b/docs/concepts.rst @@ -47,8 +47,12 @@ Assigning neighboring tests to different event loop scopes is discouraged as it Test discovery modes ==================== -Pytest-asyncio provides two modes for test discovery, *strict* and *auto*. +Pytest-asyncio provides two modes for test discovery, *strict* and *auto*. This can be set through Pytest's ``--asyncio-mode`` command line flag, or through the configuration file: +.. code-block:: toml + + [tool.pytest.ini_options] + asyncio_mode = "auto" # or "strict" Strict mode -----------