Add initial infected asyncio error propagation test

iaio_backup
Tyler Goodlet 2020-12-10 13:49:11 -05:00
parent 2cf98d5e09
commit 7b149dd3e4
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
import asyncio
import pytest
import tractor
async def sleep_and_err():
await asyncio.sleep(0.1)
assert 0
async def trio_main():
await tractor.to_asyncio.run_task(sleep_and_err)
def test_infected_simple_error(arb_addr):
async def main():
async with tractor.open_nursery() as n:
await n.run_in_actor('asyncio_actor', trio_main, infected_asyncio=True)
with pytest.raises(tractor.RemoteActorError) as excinfo:
tractor.run(main, arbiter_addr=arb_addr)