Skip to content

Commit

Permalink
fix test_reconnect_argument_deprecated
Browse files Browse the repository at this point in the history
was leaking file descriptors, and needed an event loop
  • Loading branch information
gjoseph92 committed May 20, 2022
1 parent ba78fa2 commit 305a23f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions distributed/tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3536,13 +3536,17 @@ async def close():
await asyncio.gather(block(), close(), set_future())


def test_reconnect_argument_deprecated():
@gen_cluster(nthreads=[])
async def test_reconnect_argument_deprecated(s):
with pytest.deprecated_call(match="`reconnect` argument"):
Worker("tcp://localhost:8786", reconnect=False)
async with Worker(s.address, reconnect=False):
pass
with pytest.raises(ValueError, match="reconnect=True"):
Worker("tcp://localhost:8786", reconnect=True)
async with Worker(s.address, reconnect=True):
pass

with warnings.catch_warnings():
# No argument should not warn or raise
warnings.simplefilter("error")
Worker("tcp://localhost:8786")
async with Worker(s.address):
pass

0 comments on commit 305a23f

Please sign in to comment.