From 30ea7a06b0a5f4fd3635ed0f10c13e57c6a19baf Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 11 Oct 2022 13:48:27 -0400 Subject: [PATCH] Avoid inf nursery hang by reversing `async with` ordering --- tests/test_infected_asyncio.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_infected_asyncio.py b/tests/test_infected_asyncio.py index 30ddfb6..ac8cbcd 100644 --- a/tests/test_infected_asyncio.py +++ b/tests/test_infected_asyncio.py @@ -170,11 +170,11 @@ async def trio_ctx( # message. with trio.fail_after(2): async with ( + trio.open_nursery() as n, + tractor.to_asyncio.open_channel_from( sleep_and_err, ) as (first, chan), - - trio.open_nursery() as n, ): assert first == 'start'