Skip to content

Commit

Permalink
Merge pull request #199 from netomi/fix-test-errors-with-python3.11
Browse files Browse the repository at this point in the history
Fix exceptions encountered during tests with python 3.11
  • Loading branch information
JWCook committed Oct 30, 2023
2 parents 8ce8498 + 5a44412 commit efe57fb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
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

0 comments on commit efe57fb

Please sign in to comment.