From b209990d045c9069b11279916dc529bbe3152b0b Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 14 Apr 2024 19:39:57 -0400 Subject: [PATCH] Flip a last `MultiError` to a beg, add todo on `@stream` func --- tests/test_context_stream_semantics.py | 4 ++-- tests/test_legacy_one_way_streaming.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_context_stream_semantics.py b/tests/test_context_stream_semantics.py index 5df133d..cedddf7 100644 --- a/tests/test_context_stream_semantics.py +++ b/tests/test_context_stream_semantics.py @@ -246,10 +246,10 @@ def test_simple_context( trio.run(main) except error_parent: pass - except trio.MultiError as me: + except BaseExceptionGroup as beg: # XXX: on windows it seems we may have to expect the group error from tractor._exceptions import is_multi_cancelled - assert is_multi_cancelled(me) + assert is_multi_cancelled(beg) else: trio.run(main) diff --git a/tests/test_legacy_one_way_streaming.py b/tests/test_legacy_one_way_streaming.py index 1e7ec98..6092bca 100644 --- a/tests/test_legacy_one_way_streaming.py +++ b/tests/test_legacy_one_way_streaming.py @@ -38,10 +38,13 @@ async def async_gen_stream(sequence): assert cs.cancelled_caught +# TODO: deprecated either remove entirely +# or re-impl in terms of `MsgStream` one-sides +# wrapper, but at least remove `Portal.open_stream_from()` @tractor.stream async def context_stream( ctx: tractor.Context, - sequence + sequence: list[int], ): for i in sequence: await ctx.send_yield(i)