diff --git a/tests/test_asyncio/test_cluster.py b/tests/test_asyncio/test_cluster.py index c16272bb5b..fefa4ef8f9 100644 --- a/tests/test_asyncio/test_cluster.py +++ b/tests/test_asyncio/test_cluster.py @@ -313,7 +313,8 @@ async def mock_aclose(): called += 1 with mock.patch.object(cluster, "aclose", mock_aclose): - await cluster.close() + with pytest.warns(DeprecationWarning, match=r"Use aclose\(\) instead"): + await cluster.close() assert called == 1 await cluster.aclose()