forked from goodboy/tractor
1
0
Fork 0

Try to handle variable windows errors

immediate_remote_cancels
Tyler Goodlet 2021-10-14 12:12:13 -04:00
parent 9d83ef82b2
commit 7ee121aeaf
1 changed files with 11 additions and 1 deletions

View File

@ -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)