Sprinkle `spawn_method` fixture throughout tests

spawn_method_support
Tyler Goodlet 2019-03-06 00:37:02 -05:00
parent 483ae42a46
commit d6ca722bcc
3 changed files with 10 additions and 6 deletions

View File

@ -110,7 +110,7 @@ async def stream_forever():
@tractor_test @tractor_test
async def test_cancel_infinite_streamer(): async def test_cancel_infinite_streamer(spawn_method):
# stream for at most 1 seconds # stream for at most 1 seconds
with trio.move_on_after(1) as cancel_scope: with trio.move_on_after(1) as cancel_scope:
@ -139,7 +139,7 @@ async def test_cancel_infinite_streamer():
ids=['one_actor', 'two_actors'], ids=['one_actor', 'two_actors'],
) )
@tractor_test @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 """Verify a subset of failed subactors causes all others in
the nursery to be cancelled just like the strategy in trio. the nursery to be cancelled just like the strategy in trio.

View File

@ -57,7 +57,7 @@ def movie_theatre_question():
@tractor_test @tractor_test
async def test_movie_theatre_convo(): async def test_movie_theatre_convo(spawn_method):
"""The main ``tractor`` routine. """The main ``tractor`` routine.
""" """
async with tractor.open_nursery() as n: async with tractor.open_nursery() as n:
@ -83,7 +83,7 @@ def cellar_door():
@tractor_test @tractor_test
async def test_most_beautiful_word(): async def test_most_beautiful_word(spawn_method):
"""The main ``tractor`` routine. """The main ``tractor`` routine.
""" """
async with tractor.open_nursery() as n: async with tractor.open_nursery() as n:

View File

@ -62,10 +62,14 @@ async def stream_from_single_subactor():
# await nursery.cancel() # 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. """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 # this is the first 2 actors, streamer_1 and streamer_2