Skip to content

Commit

Permalink
Catch a known DeprecationWarning when calling .close() (#3335)
Browse files Browse the repository at this point in the history
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
  • Loading branch information
kurtmckee and vladvildanov authored Sep 2, 2024
1 parent 93b9d85 commit b4fcbaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_asyncio/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit b4fcbaa

Please sign in to comment.