Skip to content

Commit f1aa98a

Browse files
chore: delete aiohttp dependency (#477)
aiohttp is not being used anymore. So we can delete it. This PR also fixes test_instance.py, because RefreshAheadCache takes in FakeAlloyDBClient instead of aiohttp.ClientSession.
1 parent c95885f commit f1aa98a

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ classifiers = [
4242
]
4343
dependencies = [
4444
"aiofiles",
45-
"aiohttp",
4645
"cryptography>=42.0.0",
4746
"requests",
4847
"google-auth",

requirements-test.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ psycopg2-binary==2.9.10; python_version != "3.9" or sys_platform != "darwin"
1313
pytest==8.4.1
1414
pytest-asyncio==1.1.0
1515
pytest-cov==6.2.1
16-
pytest-aiohttp==1.1.0
1716
SQLAlchemy[asyncio]==2.0.43
18-
aioresponses==0.7.8
17+
aioresponses==0.7.8

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
aiofiles==24.1.0
2-
aiohttp==3.12.14
32
cryptography==45.0.6
43
google-auth==2.40.3
54
requests==2.32.4
6-
protobuf==6.31.1
5+
protobuf==6.31.1

tests/unit/test_instance.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from datetime import datetime
1717
from datetime import timedelta
1818

19-
import aiohttp
2019
from mocks import FakeAlloyDBClient
2120
import pytest
2221

@@ -71,18 +70,18 @@ async def test_RefreshAheadCache_init() -> None:
7170
can tell if the instance URI that's passed in is formatted correctly.
7271
"""
7372
keys = asyncio.create_task(generate_keys())
74-
async with aiohttp.ClientSession() as client:
75-
cache = RefreshAheadCache(
76-
"projects/test-project/locations/test-region/clusters/test-cluster/instances/test-instance",
77-
client,
78-
keys,
79-
)
80-
assert (
81-
cache._project == "test-project"
82-
and cache._region == "test-region"
83-
and cache._cluster == "test-cluster"
84-
and cache._name == "test-instance"
85-
)
73+
client = FakeAlloyDBClient()
74+
cache = RefreshAheadCache(
75+
"projects/test-project/locations/test-region/clusters/test-cluster/instances/test-instance",
76+
client,
77+
keys,
78+
)
79+
assert (
80+
cache._project == "test-project"
81+
and cache._region == "test-region"
82+
and cache._cluster == "test-cluster"
83+
and cache._name == "test-instance"
84+
)
8685

8786

8887
@pytest.mark.asyncio
@@ -92,9 +91,9 @@ async def test_RefreshAheadCache_init_invalid_instant_uri() -> None:
9291
will throw error for invalid instance URI.
9392
"""
9493
keys = asyncio.create_task(generate_keys())
95-
async with aiohttp.ClientSession() as client:
96-
with pytest.raises(ValueError):
97-
RefreshAheadCache("invalid/instance/uri/", client, keys)
94+
client = FakeAlloyDBClient()
95+
with pytest.raises(ValueError):
96+
RefreshAheadCache("invalid/instance/uri/", client, keys)
9897

9998

10099
@pytest.mark.asyncio

0 commit comments

Comments
 (0)