Skip to content

Commit 4354d7c

Browse files
committed
opt into strict mode by default
1 parent 25c54a5 commit 4354d7c

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

CHANGELOG.rst

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44

55
UNRELEASED
66
=================
7+
- BREAKING: The default ``asyncio_mode`` is now *strict*. `#293 <https://github.com/pytest-dev/pytest-asyncio/issues/293>`_
78
- 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 <https://github.com/pytest-dev/pytest-asyncio/issues/283>`_
89
- Add support for Python 3.11.
910

README.rst

+6-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Modes
5858
-----
5959

6060
Starting from ``pytest-asyncio>=0.17``, three modes are provided: *auto*, *strict* and
61-
*legacy* (default).
61+
*legacy*. Starting from ``pytest-asyncio>=0.19`` the *strict* mode is the default.
6262

6363
The mode can be set by ``asyncio_mode`` configuration option in `configuration file
6464
<https://docs.pytest.org/en/latest/reference/customize.html>`_:
@@ -104,18 +104,19 @@ pytest plugin can handle them.
104104
Please use this mode if multiple async frameworks should be combined in the same test
105105
suite.
106106

107+
This mode is used by default for the sake of project inter-compatibility.
108+
107109

108110
Legacy mode
109111
~~~~~~~~~~~
110112

111113
This mode follows rules used by ``pytest-asyncio<0.17``: tests are not auto-marked but
112114
fixtures are.
113115

114-
This mode is used by default for the sake of backward compatibility, deprecation
115-
warnings are emitted with suggestion to either switching to ``auto`` mode or using
116-
``strict`` mode with ``@pytest_asyncio.fixture`` decorators.
116+
Deprecation warnings are emitted with suggestion to either switching to ``auto`` mode
117+
or using ``strict`` mode with ``@pytest_asyncio.fixture`` decorators.
117118

118-
In future, the default will be changed.
119+
The default was changed to ``strict`` in ``pytest-asyncio>=0.19``.
119120

120121

121122
Fixtures

pytest_asyncio/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def pytest_addoption(parser: Parser, pluginmanager: PytestPluginManager) -> None
9595
parser.addini(
9696
"asyncio_mode",
9797
help="default value for --asyncio-mode",
98-
default="legacy",
98+
default="strict",
9999
)
100100

101101

0 commit comments

Comments
 (0)