2.0.0a1 - 2026-11-13
Removed
- Deprecated scope keyword argument of the asyncio marker. Use loop_scope instead. (#1475)
- Deprecated event_loop_policy fixture (#1517)
- Support for Python 3.10 (#1618)
Added
- Preliminary support for Python 3.16 (#1593)
Changed
- Breaking change: using
@pytest.fixtureon async fixtures in strict mode raisespytest.UsageErrorinstead ofPytestDeprecationWarning(#1202) - Disable asyncio policy restoration between tests on Python 3.16 and newer, since the policy system was removed in Python 3.16 (#1593)
- The return type of
pytest_asyncio.is_async_testis nowbool, so type checkers no longer narrow the item topytest.Function. (#1598)
Fixed
- Arguments to asyncio marks applied with
pytest.paramare validated like those of other asyncio marks. (#1475) - Fixed cancelled async fixture setup and teardown being propagated as
asyncio.CancelledError, which could stop other fixtures from being torn down or break later
tests that use the fixture. Also ensured ContextVars changed by async generator fixtures are
restored when their teardown raises. (#1591)