diff --git a/tests/test_discovery.py b/tests/test_discovery.py index b0aa279..eff2897 100644 --- a/tests/test_discovery.py +++ b/tests/test_discovery.py @@ -124,12 +124,15 @@ async def spawn_and_check_registry( assert not actor.is_arbiter async with tractor.get_arbiter(*arb_addr) as portal: + if actor.is_arbiter: + async def get_reg(): return actor._registry + extra = 1 # arbiter is local root actor else: - get_reg = partial(portal.run, 'self', 'get_registry') + get_reg = partial(portal.run_from_ns, 'self', 'get_registry') extra = 2 # local root actor + remote arbiter # ensure current actor is registered @@ -254,7 +257,7 @@ async def close_chans_before_nursery( async with tractor.get_arbiter(*arb_addr) as aportal: try: - get_reg = partial(aportal.run, 'self', 'get_registry') + get_reg = partial(aportal.run_from_ns, 'self', 'get_registry') async with tractor.open_nursery() as tn: portal1 = await tn.run_in_actor( @@ -264,7 +267,7 @@ async def close_chans_before_nursery( agen1 = await portal1.result() portal2 = await tn.start_actor('consumer2', rpc_module_paths=[__name__]) - agen2 = await portal2.run(__name__, 'stream_forever') + agen2 = await portal2.run(stream_forever) async with trio.open_nursery() as n: n.start_soon(streamer, agen1) diff --git a/tests/test_local.py b/tests/test_local.py index 0a594d0..ef64795 100644 --- a/tests/test_local.py +++ b/tests/test_local.py @@ -46,7 +46,7 @@ async def test_self_is_registered_localportal(arb_addr): assert actor.is_arbiter async with tractor.get_arbiter(*arb_addr) as portal: assert isinstance(portal, tractor._portal.LocalPortal) - sockaddr = await portal.run('self', 'wait_for_actor', name='arbiter') + sockaddr = await portal.run_from_ns('self', 'wait_for_actor', name='arbiter') assert sockaddr[0] == arb_addr