Verify nested boxed errors

improved_errors
Tyler Goodlet 2018-11-19 16:53:21 -05:00
parent 0a240187c6
commit 3e74cc6f11
1 changed files with 6 additions and 3 deletions

View File

@ -162,11 +162,14 @@ async def test_some_cancels_all(num_actors_and_errs):
# ``MultiError`` containing an ``AssertionError` # ``MultiError`` containing an ``AssertionError`
except first_err as err: except first_err as err:
if isinstance(err, trio.MultiError): if isinstance(err, tractor.MultiError):
assert len(err.exceptions) == num assert len(err.exceptions) == num
for exc in err.exceptions: for exc in err.exceptions:
if isinstance(exc, tractor.RemoteActorError):
assert exc.type == err_type assert exc.type == err_type
else: else:
assert isinstance(exc, trio.Cancelled)
elif isinstance(err, tractor.RemoteActorError):
assert err.type == err_type assert err.type == err_type
assert n.cancelled is True assert n.cancelled is True