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

Add deprecation warning for pytest < 7 #420

Merged
merged 1 commit into from Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -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 <https://github.com/pytest-dev/pytest-asyncio/pull/404>`_

0.19.0 (22-07-13)
Expand Down
9 changes: 9 additions & 0 deletions pytest_asyncio/plugin.py
Expand Up @@ -6,6 +6,7 @@
import inspect
import socket
import sys
import warnings
from typing import (
Any,
AsyncIterator,
Expand Down Expand Up @@ -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]:
Expand Down