Skip to content

Commit

Permalink
test: fix AsyncRedis.close() deprecation warning (#2371)
Browse files Browse the repository at this point in the history
* test: fix `AsyncRedis.close()` deprecation warning

* Fix CI

* Address review

---------

Co-authored-by: Peter Schutt <[email protected]>
  • Loading branch information
sobolevn and peterschutt authored Sep 27, 2023
1 parent e11cc06 commit 735cc6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,6 @@ async def redis_client(docker_ip: str, redis_service: None) -> AsyncGenerator[As
client: AsyncRedis = AsyncRedis(host=docker_ip, port=6397)
yield client
try:
await client.close()
await client.aclose() # type: ignore[attr-defined]
except RuntimeError:
pass
2 changes: 1 addition & 1 deletion tests/docker_service_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ async def redis_responsive(host: str) -> bool:
except (ConnectionError, RedisConnectionError):
return False
finally:
await client.close()
await client.aclose()


@pytest.fixture()
Expand Down

0 comments on commit 735cc6a

Please sign in to comment.