Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dependencies/default/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Always adjust install_requires in setup.cfg and pytest-min-requirements.txt
# when changing runtime dependencies
pytest >= 6.1.0
pytest >= 7.0.0
typing-extensions >= 3.7.2; python_version < "3.8"
34 changes: 17 additions & 17 deletions dependencies/pytest-min/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
async-generator==1.10
attrs==21.4.0
coverage==6.3.2
flaky==3.7.0
hypothesis==6.43.3
idna==3.3
argcomplete==2.0.0
attrs==22.1.0
certifi==2022.9.24
charset-normalizer==2.1.1
elementpath==3.0.2
exceptiongroup==1.0.0rc9
hypothesis==6.56.3
idna==3.4
iniconfig==1.1.1
mypy==0.942
mypy-extensions==0.4.3
outcome==1.1.0
mock==4.0.3
nose==1.3.7
packaging==21.3
pluggy==0.13.1
pluggy==1.0.0
py==1.11.0
pyparsing==3.0.8
pytest==6.1.0
pytest-trio==0.7.0
sniffio==1.2.0
Pygments==2.13.0
pyparsing==3.0.9
pytest==7.0.0
requests==2.28.1
sortedcontainers==2.4.0
toml==0.10.2
tomli==2.0.1
trio==0.20.0
typing_extensions==4.2.0
urllib3==1.26.12
xmlschema==2.1.1
2 changes: 1 addition & 1 deletion dependencies/pytest-min/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Always adjust install_requires in setup.cfg and requirements.txt
# when changing minimum version dependencies
pytest == 6.1.0
pytest[testing] == 7.0.0
typing-extensions >= 3.7.2; python_version < "3.8"
4 changes: 4 additions & 0 deletions docs/source/reference/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Changelog
=========

UNRELEASED
=================
- Drop compatibility with pytest 6.1. Pytest-asyncio now depends on pytest 7.0 or newer.

0.20.3 (22-12-08)
=================
- Prevent DeprecationWarning to bubble up on CPython 3.10.9 and 3.11.1.
Expand Down
28 changes: 13 additions & 15 deletions pytest_asyncio/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@
)

import pytest
from pytest import Function, Item, Session
from pytest import (
Config,
FixtureRequest,
Function,
Item,
Parser,
PytestPluginManager,
Session,
)

if sys.version_info >= (3, 8):
from typing import Literal
Expand All @@ -46,11 +54,9 @@
FixtureFunction = Union[SimpleFixtureFunction, FactoryFixtureFunction]
FixtureFunctionMarker = Callable[[FixtureFunction], FixtureFunction]

Config = Any # pytest < 7.0
PytestPluginManager = Any # pytest < 7.0
FixtureDef = Any # pytest < 7.0
Parser = Any # pytest < 7.0
SubRequest = Any # pytest < 7.0
# https://github.com/pytest-dev/pytest/pull/9510
FixtureDef = Any
SubRequest = Any


class Mode(str, enum.Enum):
Expand Down Expand Up @@ -169,14 +175,6 @@ 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.hookimpl(tryfirst=True)
def pytest_report_header(config: Config) -> List[str]:
Expand Down Expand Up @@ -508,7 +506,7 @@ def pytest_runtest_setup(item: pytest.Item) -> None:


@pytest.fixture
def event_loop(request: "pytest.FixtureRequest") -> Iterator[asyncio.AbstractEventLoop]:
def event_loop(request: FixtureRequest) -> Iterator[asyncio.AbstractEventLoop]:
"""Create an instance of the default event loop for each test case."""
loop = asyncio.get_event_loop_policy().new_event_loop()
yield loop
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ include_package_data = True

# Always adjust requirements.txt and pytest-min-requirements.txt when changing runtime dependencies
install_requires =
pytest >= 6.1.0
pytest >= 7.0.0
typing-extensions >= 3.7.2; python_version < "3.8"

[options.extras_require]
Expand Down
26 changes: 0 additions & 26 deletions tests/test_pytest_min_version_warning.py

This file was deleted.