From 4354d7cd9e891127fb4741a50cf9a9073c3bdf9f Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Sun, 19 Jun 2022 15:04:38 +0100 Subject: [PATCH] opt into strict mode by default --- CHANGELOG.rst | 1 + README.rst | 11 ++++++----- pytest_asyncio/plugin.py | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ff7e29b4..afca3ab1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,7 @@ Changelog UNRELEASED ================= +- BREAKING: The default ``asyncio_mode`` is now *strict*. `#293 `_ - Removes `setup.py` since all relevant configuration is present `setup.cfg`. Users requiring an editable installation of pytest-asyncio need to use pip v21.1 or newer. `#283 `_ - Add support for Python 3.11. diff --git a/README.rst b/README.rst index 12c76eb0..1fc5ef47 100644 --- a/README.rst +++ b/README.rst @@ -58,7 +58,7 @@ Modes ----- Starting from ``pytest-asyncio>=0.17``, three modes are provided: *auto*, *strict* and -*legacy* (default). +*legacy*. Starting from ``pytest-asyncio>=0.19`` the *strict* mode is the default. The mode can be set by ``asyncio_mode`` configuration option in `configuration file `_: @@ -104,6 +104,8 @@ pytest plugin can handle them. Please use this mode if multiple async frameworks should be combined in the same test suite. +This mode is used by default for the sake of project inter-compatibility. + Legacy mode ~~~~~~~~~~~ @@ -111,11 +113,10 @@ Legacy mode This mode follows rules used by ``pytest-asyncio<0.17``: tests are not auto-marked but fixtures are. -This mode is used by default for the sake of backward compatibility, deprecation -warnings are emitted with suggestion to either switching to ``auto`` mode or using -``strict`` mode with ``@pytest_asyncio.fixture`` decorators. +Deprecation warnings are emitted with suggestion to either switching to ``auto`` mode +or using ``strict`` mode with ``@pytest_asyncio.fixture`` decorators. -In future, the default will be changed. +The default was changed to ``strict`` in ``pytest-asyncio>=0.19``. Fixtures diff --git a/pytest_asyncio/plugin.py b/pytest_asyncio/plugin.py index 08001faf..dd6a782b 100644 --- a/pytest_asyncio/plugin.py +++ b/pytest_asyncio/plugin.py @@ -95,7 +95,7 @@ def pytest_addoption(parser: Parser, pluginmanager: PytestPluginManager) -> None parser.addini( "asyncio_mode", help="default value for --asyncio-mode", - default="legacy", + default="strict", )