Tags: pytest-dev/pytest-asyncio
Tags
`1.4.0 <https://github.com/pytest-dev/pytest-asyncio/tree/1.4.0>`_ - … …2026-05-26 =============================================================================== Deprecated ---------- - Overriding the *event_loop_policy* fixture is deprecated. Use the ``pytest_asyncio_loop_factories`` hook instead. (`#1419 <https://github.com/pytest-dev/pytest-asyncio/issues/1419>`_) Added ----- - Added the ``pytest_asyncio_loop_factories`` hook to parametrize asyncio tests with custom event loop factories. The hook returns a mapping of factory names to loop factories, and ``pytest.mark.asyncio(loop_factories=[...])`` selects a subset of configured factories per test. When a single factory is configured, test names are unchanged. Synchronous ``@pytest_asyncio.fixture`` functions now see the correct event loop when custom loop factories are configured, even when test code disrupts the current event loop (e.g., via ``asyncio.run()`` or ``asyncio.set_event_loop(None)``). (`#1164 <https://github.com/pytest-dev/pytest-asyncio/issues/1164>`_) Changed ------- - Improved the readability of the warning message that is displayed when ``asyncio_default_fixture_loop_scope`` is unset (`#1298 <https://github.com/pytest-dev/pytest-asyncio/issues/1298>`_) - Only import ``asyncio.AbstractEventLoopPolicy`` for type checking to avoid raising a DeprecationWarning. (`#1394 <https://github.com/pytest-dev/pytest-asyncio/issues/1394>`_) - Updated minimum supported pytest version to v8.4.0. (`#1397 <https://github.com/pytest-dev/pytest-asyncio/issues/1397>`_) Fixed ----- - Fixed a ``ResourceWarning: unclosed event loop`` warning that could occur when a synchronous test called ``asyncio.run()`` or otherwise unset the current event loop after pytest-asyncio had run an async test or fixture. (`#724 <https://github.com/pytest-dev/pytest-asyncio/issues/724>`_) Notes for Downstream Packagers ------------------------------ - Added dependency on ``sphinx-tabs >= 3.5`` to organize documentation examples into tabs. (`#1395 <https://github.com/pytest-dev/pytest-asyncio/issues/1395>`_)
`1.4.0a2 <https://github.com/pytest-dev/pytest-asyncio/tree/1.4.0a2>`_ … …- 2026-05-02 =================================================================================== Deprecated ---------- - Overriding the *event_loop_policy* fixture is deprecated. Use the ``pytest_asyncio_loop_factories`` hook instead. (`#1419 <https://github.com/pytest-dev/pytest-asyncio/issues/1419>`_) Added ----- - Added the ``pytest_asyncio_loop_factories`` hook to parametrize asyncio tests with custom event loop factories. The hook returns a mapping of factory names to loop factories, and ``pytest.mark.asyncio(loop_factories=[...])`` selects a subset of configured factories per test. When a single factory is configured, test names are unchanged on pytest 8.4+. Synchronous ``@pytest_asyncio.fixture`` functions now see the correct event loop when custom loop factories are configured, even when test code disrupts the current event loop (e.g., via ``asyncio.run()`` or ``asyncio.set_event_loop(None)``). (`#1164 <https://github.com/pytest-dev/pytest-asyncio/issues/1164>`_) Changed ------- - Improved the readability of the warning message that is displayed when ``asyncio_default_fixture_loop_scope`` is unset (`#1298 <https://github.com/pytest-dev/pytest-asyncio/issues/1298>`_) - Only import ``asyncio.AbstractEventLoopPolicy`` for type checking to avoid raising a DeprecationWarning. (`#1394 <https://github.com/pytest-dev/pytest-asyncio/issues/1394>`_) - Updated minimum supported pytest version to v8.4.0. (`#1397 <https://github.com/pytest-dev/pytest-asyncio/issues/1397>`_) Fixed ----- - Fixed a ``ResourceWarning: unclosed event loop`` warning that could occur when a synchronous test called ``asyncio.run()`` or otherwise unset the current event loop after pytest-asyncio had run an async test or fixture. (`#724 <https://github.com/pytest-dev/pytest-asyncio/issues/724>`_) Notes for Downstream Packagers ------------------------------ - Added dependency on ``sphinx-tabs >= 3.5`` to organize documentation examples into tabs. (`#1395 <https://github.com/pytest-dev/pytest-asyncio/issues/1395>`_)
`1.4.0a1 <https://github.com/pytest-dev/pytest-asyncio/tree/1.4.0a1>`_ … …- 2026-04-15 =================================================================================== Added ----- - Added the ``pytest_asyncio_loop_factories`` hook to parametrize asyncio tests with custom event loop factories. The hook returns a mapping of factory names to loop factories, and ``pytest.mark.asyncio(loop_factories=[...])`` selects a subset of configured factories per test. When a single factory is configured, test names are unchanged on pytest 8.4+. Synchronous ``@pytest_asyncio.fixture`` functions now see the correct event loop when custom loop factories are configured, even when test code disrupts the current event loop (e.g., via ``asyncio.run()`` or ``asyncio.set_event_loop(None)``). (`#1164 <https://github.com/pytest-dev/pytest-asyncio/issues/1164>`_) Changed ------- - Improved the readability of the warning message that is displayed when ``asyncio_default_fixture_loop_scope`` is unset (`#1298 <https://github.com/pytest-dev/pytest-asyncio/issues/1298>`_) - Only import ``asyncio.AbstractEventLoopPolicy`` for type checking to avoid raising a DeprecationWarning. (`#1394 <https://github.com/pytest-dev/pytest-asyncio/issues/1394>`_) - Updated minimum supported pytest version to v8.4.0. (`#1397 <https://github.com/pytest-dev/pytest-asyncio/issues/1397>`_) Notes for Downstream Packagers ------------------------------ - Added dependency on ``sphinx-tabs >= 3.5`` to organize documentation examples into tabs. (`#1395 <https://github.com/pytest-dev/pytest-asyncio/issues/1395>`_)
`1.4.0a0 <https://github.com/pytest-dev/pytest-asyncio/tree/1.4.0a0>`_ … …- 2026-03-25 =================================================================================== Added ----- - Added the ``pytest_asyncio_loop_factories`` hook to parametrize asyncio tests with custom event loop factories. The hook now returns a mapping of factory names to loop factories, and ``pytest.mark.asyncio(loop_factories=[...])`` can be used to select a subset of configured factories per test. (`#1164 <https://github.com/pytest-dev/pytest-asyncio/issues/1164>`_) Changed ------- - Improved the readability of the warning message that is displayed when ``asyncio_default_fixture_loop_scope`` is unset (`#1298 <https://github.com/pytest-dev/pytest-asyncio/issues/1298>`_)
`1.3.0 <https://github.com/pytest-dev/pytest-asyncio/tree/1.3.0>`_ - … …2025-11-10 =============================================================================== Removed ------- - Support for Python 3.9 (`#1278 <https://github.com/pytest-dev/pytest-asyncio/issues/1278>`_) Added ----- - Support for pytest 9 (`#1279 <https://github.com/pytest-dev/pytest-asyncio/issues/1279>`_) Notes for Downstream Packagers ------------------------------ - Tested Python versions include free threaded Python 3.14t (`#1274 <https://github.com/pytest-dev/pytest-asyncio/issues/1274>`_) - Tests are run in the same pytest process, instead of spawning a subprocess with `pytest.Pytester.runpytest_subprocess`. This prevents the test suite from accidentally using a system installation of pytest-asyncio, which could result in test errors. (`#1275 <https://github.com/pytest-dev/pytest-asyncio/issues/1275>`_)
`1.2.0 <https://github.com/pytest-dev/pytest-asyncio/tree/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 <https://github.com/pytest-dev/pytest-asyncio/issues/980>`_) - A ``pytest.UsageError`` for invalid configuration values of ``asyncio_default_fixture_loop_scope`` and ``asyncio_default_test_loop_scope``. (`#1189 <https://github.com/pytest-dev/pytest-asyncio/issues/1189>`_) - Compatibility with the `Pyright` type checker (`#731 <https://github.com/pytest-dev/pytest-asyncio/issues/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 <https://github.com/pytest-dev/pytest-asyncio/issues/1177>`_) - Deprecation warning when decorating an asynchronous fixture with ``@pytest.fixture`` in `strict` mode. The warning message now refers to the correct package. (`#1198 <https://github.com/pytest-dev/pytest-asyncio/issues/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.
`v1.1.1 <https://github.com/pytest-dev/pytest-asyncio/tree/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 <https://github.com/pytest-dev/pytest-asyncio/issues/1192>`_)
`1.1.0 <https://github.com/pytest-dev/pytest-asyncio/tree/1.1.0>`_ - … …2025-07-16 =============================================================================== Added ----- - Propagation of ContextVars from async fixtures to other fixtures and tests on Python 3.10 and older (`#127 <https://github.com/pytest-dev/pytest-asyncio/issues/127>`_) - Cancellation of tasks when the `loop_scope` ends (`#200 <https://github.com/pytest-dev/pytest-asyncio/issues/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 <https://github.com/pytest-dev/pytest-asyncio/issues/878>`_) - An error that could cause duplicate warnings to be issued Notes for Downstream Packagers ------------------------------ - Added runtime dependency on `backports.asyncio.runner <https://pypi.org/project/backports.asyncio.runner/>`__ for use with Python 3.10 and older
`1.1.0a1 <https://github.com/pytest-dev/pytest-asyncio/tree/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 <https://github.com/pytest-dev/pytest-asyncio/issues/127>`_) - Cancellation of tasks when the `loop_scope` ends (`#200 <https://github.com/pytest-dev/pytest-asyncio/issues/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 <https://github.com/pytest-dev/pytest-asyncio/issues/878>`_) - An error that could cause duplicate warnings to be issued Notes for Downstream Packagers ------------------------------ - Added runtime dependency on `backports.asyncio.runner <https://pypi.org/project/backports.asyncio.runner/>`__ for use with Python 3.10 and older
`1.0.0 <https://github.com/pytest-dev/pytest-asyncio/tree/1.0.0>`_ - … …2025-05-26 =============================================================================== Removed ------- - The deprecated *event_loop* fixture. (`#1106 <https://github.com/pytest-dev/pytest-asyncio/issues/1106>`_) Added ----- - Prelimiary support for Python 3.14 (`#1025 <https://github.com/pytest-dev/pytest-asyncio/issues/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 <https://github.com/pytest-dev/pytest-asyncio/issues/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 <https://github.com/pytest-dev/pytest-asyncio/issues/1112>`_) Fixed ----- - An error caused when using pytest's `--setup-plan` option. (`#630 <https://github.com/pytest-dev/pytest-asyncio/issues/630>`_) - Unsuppressed import errors with pytest option ``--doctest-ignore-import-errors`` (`#797 <https://github.com/pytest-dev/pytest-asyncio/issues/797>`_) - A "fixture not found" error in connection with package-scoped loops (`#1052 <https://github.com/pytest-dev/pytest-asyncio/issues/1052>`_) Notes for Downstream Packagers ------------------------------ - Removed a test that had an ordering dependency on other tests. (`#1114 <https://github.com/pytest-dev/pytest-asyncio/issues/1114>`_)
PreviousNext