diff --git a/tests/test_asyncio/test_cluster.py b/tests/test_asyncio/test_cluster.py index ac879f35..b66045f1 100644 --- a/tests/test_asyncio/test_cluster.py +++ b/tests/test_asyncio/test_cluster.py @@ -315,7 +315,8 @@ async def mock_aclose(): called += 1 with mock.patch.object(cluster, "aclose", mock_aclose): - await cluster.close() + with pytest.deprecated_call(): + await cluster.close() assert called == 1 await cluster.aclose() diff --git a/tests/test_asyncio/test_cwe_404.py b/tests/test_asyncio/test_cwe_404.py index 2089aed2..3db1f574 100644 --- a/tests/test_asyncio/test_cwe_404.py +++ b/tests/test_asyncio/test_cwe_404.py @@ -261,4 +261,4 @@ async def doit(): await asyncio.gather(*[doit() for _ in range(10)]) finally: - await r.close() + await r.aclose() diff --git a/valkey/asyncio/connection.py b/valkey/asyncio/connection.py index 5bc3e46c..aa46fe51 100644 --- a/valkey/asyncio/connection.py +++ b/valkey/asyncio/connection.py @@ -328,7 +328,7 @@ async def connect(self): # Use the passed function valkey_connect_func ( await self.valkey_connect_func(self) - if asyncio.iscoroutinefunction(self.valkey_connect_func) + if inspect.iscoroutinefunction(self.valkey_connect_func) else self.valkey_connect_func(self) ) except ValkeyError: