Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opt into strict mode by default #380

Merged
merged 2 commits into from Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.
seifertm marked this conversation as resolved.
Show resolved Hide resolved

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