From d6ca722bcc285427edb7d1475fba6f8c10b87f17 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 6 Mar 2019 00:37:02 -0500 Subject: [PATCH] Sprinkle `spawn_method` fixture throughout tests --- tests/test_cancellation.py | 4 ++-- tests/test_spawning.py | 4 ++-- tests/test_streaming.py | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/test_cancellation.py b/tests/test_cancellation.py index a6e2813..b34c602 100644 --- a/tests/test_cancellation.py +++ b/tests/test_cancellation.py @@ -110,7 +110,7 @@ async def stream_forever(): @tractor_test -async def test_cancel_infinite_streamer(): +async def test_cancel_infinite_streamer(spawn_method): # stream for at most 1 seconds with trio.move_on_after(1) as cancel_scope: @@ -139,7 +139,7 @@ async def test_cancel_infinite_streamer(): ids=['one_actor', 'two_actors'], ) @tractor_test -async def test_some_cancels_all(num_actors_and_errs): +async def test_some_cancels_all(num_actors_and_errs, spawn_method): """Verify a subset of failed subactors causes all others in the nursery to be cancelled just like the strategy in trio. diff --git a/tests/test_spawning.py b/tests/test_spawning.py index 07dd737..0107115 100644 --- a/tests/test_spawning.py +++ b/tests/test_spawning.py @@ -57,7 +57,7 @@ def movie_theatre_question(): @tractor_test -async def test_movie_theatre_convo(): +async def test_movie_theatre_convo(spawn_method): """The main ``tractor`` routine. """ async with tractor.open_nursery() as n: @@ -83,7 +83,7 @@ def cellar_door(): @tractor_test -async def test_most_beautiful_word(): +async def test_most_beautiful_word(spawn_method): """The main ``tractor`` routine. """ async with tractor.open_nursery() as n: diff --git a/tests/test_streaming.py b/tests/test_streaming.py index 2cddd41..d77d562 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@ -62,10 +62,14 @@ async def stream_from_single_subactor(): # await nursery.cancel() -def test_stream_from_single_subactor(arb_addr): +def test_stream_from_single_subactor(arb_addr, spawn_method): """Verify streaming from a spawned async generator. """ - tractor.run(stream_from_single_subactor, arbiter_addr=arb_addr) + tractor.run( + stream_from_single_subactor, + arbiter_addr=arb_addr, + spawn_method=spawn_method, + ) # this is the first 2 actors, streamer_1 and streamer_2