pypi / pytest-asyncio
pytest-asyncio
What changed in pytest-asyncio 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
3 breaking1 deprecations3 new APIs and options1 performance1 behavior and defaults1 tooling9 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpytest-asyncio 119 changes
Breaking changes 3
The minimum supported pytest version is now 8.4.0.
Support for Python 3.9 was removed.
The deprecated event_loop fixture was removed.
Deprecations 1
Overriding the fixture is deprecated; use the
pytest_asyncio_loop_factorieshook instead.
New APIs and options 3
The fixture-scope value makes an asynchronous fixture without loop_scope use its scope as its loop scope, matching the behavior of an unset option in pytest-asyncio 1.x.
A hook returns a mapping of factory names to event loop factories, allowing asyncio tests to be parametrized with custom factories.
Select a subset of configured loop factories for a test; when a single factory is configured, test names are unchanged.
Performance 1
Scoped event loops are created once rather than per scope, reducing the number of fixtures and speeding up collection time.
Behavior and default changes 1
The loop_scope argument no longer requires a pytest Collector at the specified scope.
Tooling 1
pytest-asyncio now supports pytest 9.
Fixes and other changes 9
Invalid arguments to the asyncio marker, including an invalid loop_scope, are reported with a message naming the test instead of a traceback.
AsyncIterable is now allowed as a return type for asynchronous generator fixtures decorated with pytest_asyncio.fixture.
Support for Python 3.15 was declared.
Synchronous fixture functions now see the correct event loop with custom loop factories, even if test code disrupts the current loop.
Fixes a ResourceWarning that could occur when a synchronous test called
asyncio.run()or otherwise unset the current event loop after an async test or fixture.Import errors with this pytest option are now suppressed.
Fixed a "fixture not found" error in connection with package-scoped loops.
Preliminary support for Python 3.14 was added.
Fixed an error caused when using pytest's --setup-plan option.