From 8eb889a7455b23b120dc6c016424e3e6847469f6 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 13 Jun 2021 20:26:41 -0400 Subject: [PATCH] Modernize streaming tests --- tests/test_streaming.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_streaming.py b/tests/test_streaming.py index 43acb95..8c8d07e 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@ -32,13 +32,16 @@ async def async_gen_stream(sequence): # block indefinitely waiting to be cancelled by ``aclose()`` call with trio.CancelScope() as cs: - await trio.sleep(float('inf')) + await trio.sleep_forever() assert 0 assert cs.cancelled_caught @tractor.stream -async def context_stream(ctx, sequence): +async def context_stream( + ctx: tractor.Context, + sequence +): for i in sequence: await ctx.send_yield(i) await trio.sleep(0.1)