From 9d8f30c9a130c7ac0d1cbab5114a87f068a96089de2227d8423aad149be919f3 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Mon, 12 Dec 2022 11:34:39 +0000 Subject: [PATCH] - Add py3109-compat.patch to make tests compatible with python 3.10.9. These tests are not present anymore in upstream master version so this patch could be removed in future releases. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-aiohttp?expand=0&rev=81 --- py3109-compat.patch | 76 ++++++++++++++++++++++++++++++++++++++++++ python-aiohttp.changes | 7 ++++ python-aiohttp.spec | 2 ++ 3 files changed, 85 insertions(+) create mode 100644 py3109-compat.patch diff --git a/py3109-compat.patch b/py3109-compat.patch new file mode 100644 index 0000000..6296bba --- /dev/null +++ b/py3109-compat.patch @@ -0,0 +1,76 @@ +Index: aiohttp-3.8.3/tests/test_client_request.py +=================================================================== +--- aiohttp-3.8.3.orig/tests/test_client_request.py ++++ aiohttp-3.8.3/tests/test_client_request.py +@@ -19,7 +19,6 @@ from aiohttp.client_reqrep import ( + Fingerprint, + _merge_ssl_params, + ) +-from aiohttp.helpers import PY_310 + from aiohttp.test_utils import make_mocked_coro + + +@@ -275,12 +274,6 @@ def test_host_header_ipv6_with_port(make + assert req.headers["HOST"] == "[::2]:99" + + +-@pytest.mark.xfail( +- PY_310, +- reason="No idea why ClientRequest() is constructed out of loop but " +- "it calls `asyncio.get_event_loop()`", +- raises=DeprecationWarning, +-) + def test_default_loop(loop) -> None: + asyncio.set_event_loop(loop) + req = ClientRequest("get", URL("http://python.org/")) +Index: aiohttp-3.8.3/tests/test_streams.py +=================================================================== +--- aiohttp-3.8.3.orig/tests/test_streams.py ++++ aiohttp-3.8.3/tests/test_streams.py +@@ -12,7 +12,6 @@ import pytest + from re_assert import Matches + + from aiohttp import streams +-from aiohttp.helpers import PY_310 + + DATA = b"line1\nline2\nline3\n" + +@@ -83,12 +82,6 @@ class TestStreamReader: + with pytest.raises(RuntimeError): + await stream._wait("test") + +- @pytest.mark.xfail( +- PY_310, +- reason="No idea why ClientRequest() is constructed out of loop but " +- "it calls `asyncio.get_event_loop()`", +- raises=DeprecationWarning, +- ) + def test_ctor_global_loop(self) -> None: + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) +Index: aiohttp-3.8.3/tests/test_web_app.py +=================================================================== +--- aiohttp-3.8.3.orig/tests/test_web_app.py ++++ aiohttp-3.8.3/tests/test_web_app.py +@@ -6,7 +6,7 @@ import pytest + + from aiohttp import log, web + from aiohttp.abc import AbstractAccessLogger, AbstractRouter +-from aiohttp.helpers import DEBUG, PY_36, PY_310 ++from aiohttp.helpers import DEBUG, PY_36 + from aiohttp.test_utils import make_mocked_coro + from aiohttp.typedefs import Handler + +@@ -39,12 +39,6 @@ async def test_set_loop() -> None: + assert app.loop is loop + + +-@pytest.mark.xfail( +- PY_310, +- reason="No idea why _set_loop() is constructed out of loop " +- "but it calls `asyncio.get_event_loop()`", +- raises=DeprecationWarning, +-) + def test_set_loop_default_loop() -> None: + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) diff --git a/python-aiohttp.changes b/python-aiohttp.changes index a25db23..48f44d0 100644 --- a/python-aiohttp.changes +++ b/python-aiohttp.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Dec 12 11:26:26 UTC 2022 - Daniel Garcia + +- Add py3109-compat.patch to make tests compatible with python 3.10.9. These + tests are not present anymore in upstream master version so this patch could + be removed in future releases. + ------------------------------------------------------------------- Mon Nov 7 17:49:50 UTC 2022 - Ben Greiner diff --git a/python-aiohttp.spec b/python-aiohttp.spec index 3226994..942c9c9 100644 --- a/python-aiohttp.spec +++ b/python-aiohttp.spec @@ -28,6 +28,8 @@ URL: https://github.com/aio-libs/aiohttp Source: https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-%{version}.tar.gz # PATCH-FIX-UPSTREAM aiohttp-pr7057-bump-charset-normalizer.patch gh#aio-libs/aiohttp#7057 Patch0: aiohttp-pr7057-bump-charset-normalizer.patch +# PATCH-FIX-OPENSUSE py3109-compat.patch +Patch1: py3109-compat.patch # SECTION build requirements BuildRequires: %{python_module Cython} BuildRequires: %{python_module devel >= 3.6}