The pytest-asyncio mode can be set by the asyncio_mode configuration option in the configuration file:

# pytest.ini
asyncio_mode = auto

The value can also be set via the --asyncio-mode command-line option:

$ pytest tests --asyncio-mode=strict

If the asyncio mode is set in both the pytest configuration file and the command-line option, the command-line option takes precedence. If no asyncio mode is specified, the mode defaults to strict.