Skip to content

Releases: pytest-dev/pytest-asyncio

pytest-asyncio 1.2.0

12 Sep 07:34
v1.2.0
Compare
Choose a tag to compare

1.2.0 - 2025-09-12

Added

  • --asyncio-debug CLI option and asyncio_debug configuration option to enable asyncio debug mode for the default event loop. (#980)
  • A pytest.UsageError for invalid configuration values of asyncio_default_fixture_loop_scope and asyncio_default_test_loop_scope. (#1189)
  • Compatibility with the Pyright type checker (#731)

Fixed

  • RuntimeError: There is no current event loop in thread 'MainThread' when any test unsets the event loop (such as when using asyncio.run and asyncio.Runner). (#1177)
  • Deprecation warning when decorating an asynchronous fixture with @pytest.fixture in [strict]{.title-ref} mode. The warning message now refers to the correct package. (#1198)

Notes for Downstream Packagers

  • Bump the minimum required version of tox to v4.28. This change is only relevant if you use the tox.ini file provided by pytest-asyncio to run tests.
  • Extend dependency on typing-extensions>=4.12 from Python<3.10 to Python<3.13.

pytest-asyncio 1.1.1

12 Sep 06:31
v1.1.1
Compare
Choose a tag to compare

v1.1.1 - 2025-09-12

Notes for Downstream Packagers

- Addresses a build problem with setuptoos-scm >= 9 caused by invalid setuptools-scm configuration in pytest-asyncio. (#1192)

pytest-asyncio 1.1.0

16 Jul 04:26
v1.1.0
Compare
Choose a tag to compare

Added

  • Propagation of ContextVars from async fixtures to other fixtures and tests on Python 3.10 and older (#127)
  • Cancellation of tasks when the loop_scope ends (#200)
  • Warning when the current event loop is closed by a test

Fixed

  • Error about missing loop when calling functions requiring a loop in the finally clause of a task (#878)
  • An error that could cause duplicate warnings to be issued

Notes for Downstream Packagers

pytest-asyncio 1.1.0a1

30 Jun 04:56
v1.1.0a1
Compare
Choose a tag to compare
Pre-release

1.1.0a1 - 2025-06-30

Added

  • Propagation of ContextVars from async fixtures to other fixtures and tests on Python 3.10 and older (#127)
  • Cancellation of tasks when the loop_scope ends (#200)
  • Warning when the current event loop is closed by a test

Fixed

  • Error about missing loop when calling functions requiring a loop in the finally clause of a task
    (#878)
  • An error that could cause duplicate warnings to be issued

Notes for Downstream Packagers

pytest-asyncio 1.0.0

26 May 04:55
v1.0.0
Compare
Choose a tag to compare

1.0.0 - 2025-05-26

Removed

  • The deprecated event_loop fixture.
    (#1106)

Added

  • Prelimiary support for Python 3.14
    (#1025)

Changed

  • Scoped event loops (e.g. module-scoped loops) are created once rather
    than per scope (e.g. per module). This reduces the number of fixtures
    and speeds up collection time, especially for large test suites.
    (#1107)
  • The loop_scope argument to pytest.mark.asyncio no longer forces
    that a pytest Collector exists at the level of the specified scope.
    For example, a test function marked with
    pytest.mark.asyncio(loop_scope="class") no longer requires a class
    surrounding the test. This is consistent with the behavior of the
    scope argument to pytest_asyncio.fixture.
    (#1112)

Fixed

  • An error caused when using pytest's [--setup-plan]{.title-ref}
    option.
    (#630)
  • Unsuppressed import errors with pytest option
    --doctest-ignore-import-errors
    (#797)
  • A "fixture not found" error in connection with package-scoped loops
    (#1052)

Notes for Downstream Packagers

  • Removed a test that had an ordering dependency on other tests.
    (#1114)

pytest-asyncio 1.0.0a1

09 May 13:35
v1.0.0a1
Compare
Choose a tag to compare
Pre-release

1.0.0a1 - 2025-05-09

Removed

  • The deprecated event_loop fixture.
    (#1106)

Added

  • Prelimiary support for Python 3.14
    (#1025)

Changed

  • Scoped event loops (e.g. module-scoped loops) are created once rather
    than per scope (e.g. per module). This reduces the number of fixtures
    and speeds up collection time, especially for large test suites.
    (#1107)
  • The loop_scope argument to pytest.mark.asyncio no longer forces
    that a pytest Collector exists at the level of the specified scope.
    For example, a test function marked with
    pytest.mark.asyncio(loop_scope="class") no longer requires a class
    surrounding the test. This is consistent with the behavior of the
    scope argument to pytest_asyncio.fixture.
    (#1112)

pytest-asyncio 0.26.0

25 Mar 06:22
v0.26.0
Compare
Choose a tag to compare
  • Adds configuration option that sets default event loop scope for all tests #793
  • Improved type annotations for pytest_asyncio.fixture #1045
  • Added typing-extensions as additional dependency for Python <3.10 #1045

pytest-asyncio 0.25.3

28 Jan 18:38
v0.25.3
Compare
Choose a tag to compare
  • Avoid errors in cleanup of async generators when event loop is already closed #1040

pytest-asyncio 0.25.2

08 Jan 06:20
v0.25.2
Compare
Choose a tag to compare
  • Call loop.shutdown_asyncgens() before closing the event loop to ensure async generators are closed in the same manner as asyncio.run does #1034

pytest-asyncio 0.25.1

02 Jan 05:06
v0.25.1
Compare
Choose a tag to compare
  • Fixes an issue that caused a broken event loop when a function-scoped test was executed in between two tests with wider loop scope #950
  • Improves test collection speed in auto mode #1020
  • Corrects the warning that is emitted upon redefining the event_loop fixture