Skip to content

Commit

Permalink
Try to handle variable windows errors
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Oct 14, 2021
1 parent 8dd381b commit 9b3e0a5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_cancellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,23 @@ 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 (
tractor.RemoteActorError,
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)

Expand Down Expand Up @@ -448,6 +457,7 @@ async def main():
with pytest.raises(KeyboardInterrupt):
trio.run(main)


async def spin_for(period=3):
"Sync sleep."
time.sleep(period)
Expand Down

0 comments on commit 9b3e0a5

Please sign in to comment.