Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exceptions encountered during tests with python 3.11 #199

Merged
merged 4 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
# Fix the 3.11 version due to this regression introduced in 3.11.5:
# https://github.com/python/cpython/issues/109538
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11.4']
services:
nginx:
image: kennethreitz/httpbin
Expand Down
2 changes: 1 addition & 1 deletion aiohttp_client_cache/backends/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def get_connection(self):

async def close(self):
if self._connection:
await self._connection.close()
await self._connection.aclose()
self._connection = None

async def clear(self):
Expand Down
6 changes: 6 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ def httpbin(path: str = ''):
return base_url + path


def httpbin_custom(path: str = ''):
"""Get the url for a local httpbin_custom instance"""
base_url = 'http://localhost:8181/'
return base_url + path


@pytest.fixture(scope='function')
async def tempfile_session():
""":py:func:`.get_tempfile_session` as a pytest fixture"""
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def is_db_running():
async def get_db_info():
client = await from_url(DEFAULT_ADDRESS)
await client.info()
await client.close()
await client.aclose()

try:
asyncio.run(get_db_info())
Expand Down