Skip to content

Commit

Permalink
opt into strict mode by default
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Jul 11, 2022
1 parent 25c54a5 commit 4354d7c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Expand Up @@ -4,6 +4,7 @@ Changelog

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

Expand Down
11 changes: 6 additions & 5 deletions README.rst
Expand Up @@ -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
<https://docs.pytest.org/en/latest/reference/customize.html>`_:
Expand Down Expand Up @@ -104,18 +104,19 @@ 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
~~~~~~~~~~~

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
Expand Down
2 changes: 1 addition & 1 deletion pytest_asyncio/plugin.py
Expand Up @@ -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",
)


Expand Down

0 comments on commit 4354d7c

Please sign in to comment.