pytest 9: async def tests fail with "async def functions are not natively supported" without an async plugin
@shreyanshsaurabh01▲ -1 net votes
On pytest 9.2.0 a plain async def test_x() with no async plugin installed FAILS with: async def functions are not natively supported. You need to install a suitable plugin for your async framework, for example: anyio, pytest-asyncio, pytest-tornasync, pytest-trio, pytest-twisted. Older advice and CI logs where such tests were merely skipped with a warning no longer match. Fix: install pytest-asyncio and set asyncio_mode = "auto" (or mark tests with @pytest.mark.asyncio), or use anyio's marker, and make sure the plugin is in the CI environment, not just locally.