From 8a0441fa9676e4f25eb9060cac12f3020ec29eae Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Mon, 21 Apr 2025 15:36:21 +0100 Subject: [PATCH 1/3] Deprecate aiohttp.pytest_plugin --- aiohttp/pytest_plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aiohttp/pytest_plugin.py b/aiohttp/pytest_plugin.py index 128dc46081d..0084717808c 100644 --- a/aiohttp/pytest_plugin.py +++ b/aiohttp/pytest_plugin.py @@ -208,6 +208,7 @@ def pytest_pyfunc_call(pyfuncitem): # type: ignore[no-untyped-def] """Run coroutines in an event loop instead of a normal function call.""" fast = pyfuncitem.config.getoption("--aiohttp-fast") if inspect.iscoroutinefunction(pyfuncitem.function): + warnings.warn("aiohttp.pytest_plugin will be removed in v4. Please install pytest-aiohttp.", DeprecationWarning) existing_loop = pyfuncitem.funcargs.get( "proactor_loop" ) or pyfuncitem.funcargs.get("loop", None) From ba5ef3a9167a894770e6faef3ce72619c0453c2c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 14:39:20 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- aiohttp/pytest_plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aiohttp/pytest_plugin.py b/aiohttp/pytest_plugin.py index 0084717808c..029d8281dd3 100644 --- a/aiohttp/pytest_plugin.py +++ b/aiohttp/pytest_plugin.py @@ -208,7 +208,10 @@ def pytest_pyfunc_call(pyfuncitem): # type: ignore[no-untyped-def] """Run coroutines in an event loop instead of a normal function call.""" fast = pyfuncitem.config.getoption("--aiohttp-fast") if inspect.iscoroutinefunction(pyfuncitem.function): - warnings.warn("aiohttp.pytest_plugin will be removed in v4. Please install pytest-aiohttp.", DeprecationWarning) + warnings.warn( + "aiohttp.pytest_plugin will be removed in v4. Please install pytest-aiohttp.", + DeprecationWarning, + ) existing_loop = pyfuncitem.funcargs.get( "proactor_loop" ) or pyfuncitem.funcargs.get("loop", None) From 2bb0c7a909a4e6d3e0694beb44b52f67d3cb2270 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Tue, 22 Apr 2025 12:34:48 +0100 Subject: [PATCH 3/3] Update setup.cfg --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index 83b33d01532..bec306f4f51 100644 --- a/setup.cfg +++ b/setup.cfg @@ -147,6 +147,7 @@ addopts = # run tests that are not marked with dev_mode -m "not dev_mode" +asyncio_mode = auto filterwarnings = error ignore:module 'ssl' has no attribute 'OP_NO_COMPRESSION'. The Python interpreter is compiled against OpenSSL < 1.0.0. Ref. https.//docs.python.org/3/library/ssl.html#ssl.OP_NO_COMPRESSION:UserWarning