Skip to content

Commit d45ab21

Browse files
authored
feat: Add deprecation warning for pytest < 7. (#420)
The last v6 release of pytest was v6.2.5 on 2021-08-29. People have had more than a year to upgrade to pytest 7. It is time to sunset support for pytest 6. Signed-off-by: Michael Seifert <[email protected]>
1 parent cab20f4 commit d45ab21

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.rst

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Changelog
55
UNRELEASED
66
=================
77
- BREAKING: Removed *legacy* mode. If you're upgrading from v0.19 and you haven't configured ``asyncio_mode = legacy``, you can upgrade without taking any additional action. If you're upgrading from an earlier version or you have explicitly enabled *legacy* mode, you need to switch to *auto* or *strict* mode before upgrading to this version.
8+
- Deprecate use of pytest v6.
89
- Fixed an issue which prevented fixture setup from being cached. `#404 <https://github.com/pytest-dev/pytest-asyncio/pull/404>`_
910

1011
0.19.0 (22-07-13)

pytest_asyncio/plugin.py

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import inspect
77
import socket
88
import sys
9+
import warnings
910
from typing import (
1011
Any,
1112
AsyncIterator,
@@ -169,6 +170,14 @@ def pytest_configure(config: Config) -> None:
169170
"run using an asyncio event loop",
170171
)
171172

173+
if getattr(pytest, "__version_tuple__", (0, 0, 0) < (7,)):
174+
warnings.warn(
175+
"You're using an outdated version of pytest. Newer releases of "
176+
"pytest-asyncio will not be compatible with this pytest version. "
177+
"Please update pytest to version 7 or later.",
178+
DeprecationWarning,
179+
)
180+
172181

173182
@pytest.mark.tryfirst
174183
def pytest_report_header(config: Config) -> List[str]:

0 commit comments

Comments
 (0)