github pytest-dev/pytest-asyncio v2.0.0a1
pytest-asyncio v2.0.0a1

pre-release28 minutes ago

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.fixture on async fixtures in strict mode raises pytest.UsageError instead of PytestDeprecationWarning (#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_test is now bool, so type checkers no longer narrow the item to pytest.Function. (#1598)

Fixed

  • Arguments to asyncio marks applied with pytest.param are 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)

Notes for Downstream Packagers

  • Removed the testing and docs extras, which duplicated the test and docs dependency groups. (#1594)
  • Removed the dependency on typing-extensions. (#1598)
  • Removed dependency on backports-asyncio-runner, which was needed to support Python <= 3.10 (#1618)

Don't miss a new pytest-asyncio release

NewReleases is sending notifications on new releases.