diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5ceab47f..0bb2c052 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,7 @@ Changelog UNRELEASED ================= - 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. +- Deprecate use of pytest v6. - Fixed an issue which prevented fixture setup from being cached. `#404 `_ 0.19.0 (22-07-13) diff --git a/pytest_asyncio/plugin.py b/pytest_asyncio/plugin.py index 6fd300d5..220d5a11 100644 --- a/pytest_asyncio/plugin.py +++ b/pytest_asyncio/plugin.py @@ -6,6 +6,7 @@ import inspect import socket import sys +import warnings from typing import ( Any, AsyncIterator, @@ -169,6 +170,14 @@ def pytest_configure(config: Config) -> None: "run using an asyncio event loop", ) + if getattr(pytest, "__version_tuple__", (0, 0, 0) < (7,)): + warnings.warn( + "You're using an outdated version of pytest. Newer releases of " + "pytest-asyncio will not be compatible with this pytest version. " + "Please update pytest to version 7 or later.", + DeprecationWarning, + ) + @pytest.mark.tryfirst def pytest_report_header(config: Config) -> List[str]: