Add upstream patch for pytest 7 compatibility
Resolves: rhbz#2059944
This commit is contained in:
parent
fc32dac685
commit
f20d8182ad
|
@ -1,7 +1,7 @@
|
|||
From 04c7dcc0461852f83c079955612453c2a7672ec1 Mon Sep 17 00:00:00 2001
|
||||
From cd4824a001133fdb88eeb7346045a1165df7ce8a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
|
||||
Date: Wed, 16 Feb 2022 13:57:57 +0100
|
||||
Subject: [PATCH] unbundle llhttp
|
||||
Subject: [PATCH 1/2] Unbundle llhttp
|
||||
|
||||
---
|
||||
aiohttp/_cparser.pxd | 2 +-
|
||||
|
@ -9,7 +9,7 @@ Subject: [PATCH] unbundle llhttp
|
|||
2 files changed, 2 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/aiohttp/_cparser.pxd b/aiohttp/_cparser.pxd
|
||||
index 165dd61..49055d6 100644
|
||||
index 165dd61d..49055d6a 100644
|
||||
--- a/aiohttp/_cparser.pxd
|
||||
+++ b/aiohttp/_cparser.pxd
|
||||
@@ -10,7 +10,7 @@ from libc.stdint cimport (
|
||||
|
@ -22,7 +22,7 @@ index 165dd61..49055d6 100644
|
|||
struct llhttp__internal_s:
|
||||
int32_t _index
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 3843680..bf4837a 100644
|
||||
index 38436806..bf4837a3 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -33,12 +33,8 @@ extensions = [
|
||||
|
@ -40,5 +40,5 @@ index 3843680..bf4837a 100644
|
|||
Extension("aiohttp._helpers", ["aiohttp/_helpers.c"]),
|
||||
Extension("aiohttp._http_writer", ["aiohttp/_http_writer.c"]),
|
||||
--
|
||||
2.33.1
|
||||
2.35.1
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
From 4e637fc268bdd976490aaacb8c28a204f6955156 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Greiner <code@bnavigator.de>
|
||||
Date: Tue, 29 Mar 2022 00:24:49 +0200
|
||||
Subject: [PATCH 2/2] Fix pytest.warns(None) usage, deprecated in pytest 7
|
||||
(#6664)
|
||||
|
||||
* remove pytest.warns(None)
|
||||
|
||||
Deprecated misuse of pytest.warns()
|
||||
|
||||
https://docs.pytest.org/en/latest/deprecations.html#using-pytest-warns-none
|
||||
|
||||
* Remove duplicate test
|
||||
|
||||
test_session_close_awaitable() does the exact same thing and should throw a deprecation warning already which is caught by the general filter
|
||||
|
||||
* PR 6664 metadata
|
||||
|
||||
* "Fix" spelling. Bots everywhere!
|
||||
|
||||
* Update 6663.bugfix
|
||||
|
||||
* Update 6663.bugfix
|
||||
|
||||
Co-authored-by: Sam Bull <aa6bs0@sambull.org>
|
||||
(cherry picked from commit 936e682d1ab6c833b3e5f0cc3596882cb9cb2444)
|
||||
---
|
||||
CHANGES/6663.bugfix | 1 +
|
||||
CONTRIBUTORS.txt | 1 +
|
||||
tests/test_client_functional.py | 19 +++----------------
|
||||
3 files changed, 5 insertions(+), 16 deletions(-)
|
||||
create mode 100644 CHANGES/6663.bugfix
|
||||
|
||||
diff --git a/CHANGES/6663.bugfix b/CHANGES/6663.bugfix
|
||||
new file mode 100644
|
||||
index 00000000..ee89799a
|
||||
--- /dev/null
|
||||
+++ b/CHANGES/6663.bugfix
|
||||
@@ -0,0 +1 @@
|
||||
+Remove a deprecated usage of pytest.warns(None)
|
||||
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
|
||||
index 52c6b5c3..d0dc04fe 100644
|
||||
--- a/CONTRIBUTORS.txt
|
||||
+++ b/CONTRIBUTORS.txt
|
||||
@@ -50,6 +50,7 @@ Artem Yushkovskiy
|
||||
Arthur Darcet
|
||||
Austin Scola
|
||||
Ben Bader
|
||||
+Ben Greiner
|
||||
Ben Timby
|
||||
Benedikt Reinartz
|
||||
Bob Haddleton
|
||||
diff --git a/tests/test_client_functional.py b/tests/test_client_functional.py
|
||||
index 77126e14..479aca33 100644
|
||||
--- a/tests/test_client_functional.py
|
||||
+++ b/tests/test_client_functional.py
|
||||
@@ -2428,32 +2428,19 @@ async def test_drop_auth_on_redirect_to_other_host(
|
||||
|
||||
|
||||
async def test_async_with_session() -> None:
|
||||
- with pytest.warns(None) as cm:
|
||||
- async with aiohttp.ClientSession() as session:
|
||||
- pass
|
||||
- assert len(cm.list) == 0
|
||||
+ async with aiohttp.ClientSession() as session:
|
||||
+ pass
|
||||
|
||||
assert session.closed
|
||||
|
||||
|
||||
async def test_session_close_awaitable() -> None:
|
||||
session = aiohttp.ClientSession()
|
||||
- with pytest.warns(None) as cm:
|
||||
- await session.close()
|
||||
- assert len(cm.list) == 0
|
||||
+ await session.close()
|
||||
|
||||
assert session.closed
|
||||
|
||||
|
||||
-async def test_close_run_until_complete_not_deprecated() -> None:
|
||||
- session = aiohttp.ClientSession()
|
||||
-
|
||||
- with pytest.warns(None) as cm:
|
||||
- await session.close()
|
||||
-
|
||||
- assert len(cm.list) == 0
|
||||
-
|
||||
-
|
||||
async def test_close_resp_on_error_async_with_session(aiohttp_server) -> None:
|
||||
async def handler(request):
|
||||
resp = web.StreamResponse(headers={"content-length": "100"})
|
||||
--
|
||||
2.35.1
|
||||
|
|
@ -4,14 +4,17 @@
|
|||
|
||||
Name: python-%{srcname}
|
||||
Version: 3.8.1
|
||||
Release: 3%{?dist}
|
||||
Release: 4%{?dist}
|
||||
Summary: Python HTTP client/server for asyncio
|
||||
|
||||
License: ASL 2.0
|
||||
URL: https://github.com/aio-libs/aiohttp
|
||||
Source0: %{pypi_source}
|
||||
|
||||
Patch0: aiohttp-3.8.1-unbundle-llhttp.patch
|
||||
# downstream only patch
|
||||
Patch: 0001-Unbundle-llhttp.patch
|
||||
# https://github.com/aio-libs/aiohttp/commit/936e682d1ab6c833b3e5f0cc3596882cb9cb2444
|
||||
Patch: 0002-Fix-pytest.warns-None-usage-deprecated-in-pytest-7-6.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
|
||||
|
@ -100,6 +103,10 @@ cython -3 aiohttp/*.pyx -I aiohttp
|
|||
%exclude %{python3_sitearch}/examples/
|
||||
|
||||
%changelog
|
||||
* Thu Apr 28 2022 Carl George <carl@george.computer> - 3.8.1-4
|
||||
- Add upstream patch for pytest 7 compatibility
|
||||
- Resolves: rhbz#2059944
|
||||
|
||||
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
|
|
Loading…
Reference in New Issue