Skip to content

Commit 2182ea2

Browse files
CagriYoncapvital
andcommitted
fix(aiohttp): remove support for older versions of aiohttp
Co-authored-by: Paulo Vital <[email protected]> Signed-off-by: Cagri Yonca <[email protected]>
1 parent 9b338e3 commit 2182ea2

File tree

2 files changed

+37
-18
lines changed

2 files changed

+37
-18
lines changed

tests/conftest.py

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@
3434
# ppc64le and s390x have limitations with some supported libraries.
3535
machine, py_version = get_runtime_env_info()
3636
if machine in ["ppc64le", "s390x"]:
37-
collect_ignore_glob.extend([
38-
"*test_google-cloud*",
39-
"*test_pymongo*",
40-
])
37+
collect_ignore_glob.extend(
38+
[
39+
"*test_google-cloud*",
40+
"*test_pymongo*",
41+
]
42+
)
4143

4244
if machine == "ppc64le":
4345
collect_ignore_glob.append("*test_grpcio*")
@@ -51,28 +53,44 @@
5153
collect_ignore_glob.append("*test_couchbase*")
5254

5355
if not os.environ.get("GEVENT_STARLETTE_TEST"):
54-
collect_ignore_glob.extend([
55-
"*test_gevent*",
56-
"*test_starlette*",
57-
])
56+
collect_ignore_glob.extend(
57+
[
58+
"*test_gevent*",
59+
"*test_starlette*",
60+
]
61+
)
5862

5963
if not os.environ.get("KAFKA_TEST"):
6064
collect_ignore_glob.append("*kafka/test*")
6165

66+
# Currently asyncio and tornado_server depends on aiohttp and
67+
# since aiohttp versions < 3.12.14 have vulnerability we skip the tests below
68+
if sys.version_info < (3, 9):
69+
collect_ignore_glob.extend(
70+
[
71+
"*test_aiohttp*",
72+
"*test_asyncio*",
73+
"*test_tornado_server*",
74+
]
75+
)
76+
6277
if sys.version_info >= (3, 12):
6378
# Currently Spyne does not support python > 3.12
6479
collect_ignore_glob.append("*test_spyne*")
6580

6681

6782
if sys.version_info >= (3, 14):
68-
collect_ignore_glob.extend([
69-
# Currently not installable dependencies because of 3.14 incompatibilities
70-
"*test_fastapi*",
71-
# aiohttp-server tests failing due to deprecated methods used
72-
"*test_aiohttp_server*",
73-
# Currently Sanic does not support python >= 3.14
74-
"*test_sanic*",
75-
])
83+
collect_ignore_glob.extend(
84+
[
85+
# Currently not installable dependencies because of 3.14 incompatibilities
86+
"*test_fastapi*",
87+
# aiohttp-server tests failing due to deprecated methods used
88+
"*test_aiohttp_server*",
89+
# Currently Sanic does not support python >= 3.14
90+
"*test_sanic*",
91+
]
92+
)
93+
7694

7795
@pytest.fixture(scope="session")
7896
def celery_config():
@@ -253,10 +271,12 @@ def announce(monkeypatch, request) -> None:
253271
else:
254272
monkeypatch.setattr(HostAgent, "announce", always_true)
255273

274+
256275
# Mocking the import of uwsgi
257276
def _uwsgi_masterpid() -> int:
258277
return 12345
259278

279+
260280
module = type(sys)("uwsgi")
261281
module.opt = {
262282
"master": True,

tests/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
-r requirements-minimal.txt
22
aioamqp>=0.15.0
33
aiofiles>=0.5.0
4-
aiohttp<=3.10.11; python_version <= "3.8"
5-
aiohttp>=3.8.3; python_version > "3.8"
4+
aiohttp>=3.12.14; python_version >= "3.9"
65
aio-pika>=9.5.2
76
boto3>=1.17.74
87
bottle>=0.12.25

0 commit comments

Comments
 (0)