Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 836 Bytes

change_default_test_loop.rst

File metadata and controls

24 lines (17 loc) · 836 Bytes

How to change the default event loop scope of all tests

The :ref:`configuration/asyncio_default_test_loop_scope` configuration option sets the default event loop scope for asynchronous tests. The following code snippets configure all tests to run in a session-scoped loop by default:

[pytest]
asyncio_default_test_loop_scope = session
[tool.pytest.ini_options]
asyncio_default_test_loop_scope = "session"
[tool:pytest]
asyncio_default_test_loop_scope = session

Please refer to :ref:`configuration/asyncio_default_test_loop_scope` for other valid scopes.