diff --git a/tests/test_cancellation.py b/tests/test_cancellation.py index 5da87ce..4271d8f 100644 --- a/tests/test_cancellation.py +++ b/tests/test_cancellation.py @@ -365,7 +365,8 @@ async def test_nested_multierrors(loglevel, start_method): # to happen before an actor is spawned if isinstance(subexc, trio.Cancelled): continue - else: + + elif isinstance(subexc, tractor.RemoteActorError): # on windows it seems we can't exactly be sure wtf # will happen.. assert subexc.type in ( @@ -373,6 +374,14 @@ async def test_nested_multierrors(loglevel, start_method): trio.Cancelled, trio.MultiError ) + + elif isinstance(subexc, trio.MultiError): + for subsub in subexc.exceptions: + assert subsub.type in ( + tractor.RemoteActorError, + trio.Cancelled, + trio.MultiError + ) else: assert isinstance(subexc, tractor.RemoteActorError) @@ -448,6 +457,7 @@ def test_cancel_via_SIGINT_other_task( with pytest.raises(KeyboardInterrupt): trio.run(main) + async def spin_for(period=3): "Sync sleep." time.sleep(period)