- 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
This commit is contained in:
Daniel Garcia 2022-12-12 11:34:39 +00:00 committed by Git OBS Bridge
parent 0138a08667
commit 9d8f30c9a1
3 changed files with 85 additions and 0 deletions

76
py3109-compat.patch Normal file
View File

@ -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)

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Dec 12 11:26:26 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- 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 <code@bnavigator.de>

View File

@ -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}