From a04a25ffbe6367422ba597e26ba59cd552d7df19 Mon Sep 17 00:00:00 2001 From: fjetter Date: Tue, 16 Jul 2024 14:39:28 +0200 Subject: [PATCH] assert on deprecation warning --- distributed/tests/test_client.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/distributed/tests/test_client.py b/distributed/tests/test_client.py index c3c4051929..efdb3dab12 100644 --- a/distributed/tests/test_client.py +++ b/distributed/tests/test_client.py @@ -243,16 +243,20 @@ async def test_map_retries(c, s, a, b): @gen_cluster(client=True) async def test_map_batch_size(c, s, a, b): - result = c.map(inc, range(100), batch_size=10) + with pytest.deprecated_call(match="batch_size"): + result = c.map(inc, range(100), batch_size=10) result = await c.gather(result) assert result == list(range(1, 101)) - result = c.map(add, range(100), range(100), batch_size=10) + with pytest.deprecated_call(match="batch_size"): + result = c.map(add, range(100), range(100), batch_size=10) result = await c.gather(result) assert result == list(range(0, 200, 2)) # mismatch shape - result = c.map(add, range(100, 200), range(10), batch_size=2) + + with pytest.deprecated_call(match="batch_size"): + result = c.map(add, range(100, 200), range(10), batch_size=2) result = await c.gather(result) assert result == list(range(100, 120, 2)) @@ -261,12 +265,13 @@ async def test_map_batch_size(c, s, a, b): async def test_custom_key_with_batches(c, s, a, b): """Test of """ - futs = c.map( - lambda x: x**2, - range(10), - batch_size=5, - key=[str(x) for x in range(10)], - ) + with pytest.deprecated_call(match="batch_size"): + futs = c.map( + lambda x: x**2, + range(10), + batch_size=5, + key=[str(x) for x in range(10)], + ) assert len(futs) == 10 await wait(futs)