Make rpc_module_paths a list

dereg_on_channel_aclose
Tyler Goodlet 2020-08-13 11:53:45 -04:00
parent 8a995beb6a
commit 1ae0efb033
3 changed files with 7 additions and 5 deletions

View File

@ -130,7 +130,7 @@ def daemon(loglevel, testdir, arb_addr):
cmdargs = [
sys.executable, '-c',
"import tractor; tractor.run_daemon((), arbiter_addr={}, loglevel={})"
"import tractor; tractor.run_daemon([], arbiter_addr={}, loglevel={})"
.format(
arb_addr,
"'{}'".format(loglevel) if loglevel else None)

View File

@ -4,7 +4,7 @@ tractor: An actor model micro-framework built on
"""
import importlib
from functools import partial
from typing import Tuple, Any, Optional
from typing import Tuple, Any, Optional, List
import typing
import trio # type: ignore
@ -115,7 +115,7 @@ def run(
def run_daemon(
rpc_module_paths: Tuple[str],
rpc_module_paths: List[str],
**kwargs
) -> None:
"""Spawn daemon actor which will respond to RPC.
@ -124,7 +124,7 @@ def run_daemon(
``tractor.run(trio.sleep(float('inf')))`` such that the first actor spawned
is meant to run forever responding to RPC requests.
"""
kwargs['rpc_module_paths'] = rpc_module_paths
kwargs['rpc_module_paths'] = list(rpc_module_paths)
for path in rpc_module_paths:
importlib.import_module(path)

View File

@ -2,7 +2,7 @@ import inspect
import platform
from functools import partial, wraps
from .. import run
from tractor import run
__all__ = ['tractor_test']
@ -38,6 +38,7 @@ def tractor_test(fn):
# injects test suite fixture value to test as well
# as `run()`
kwargs['arb_addr'] = arb_addr
if 'loglevel' in inspect.signature(fn).parameters:
# allows test suites to define a 'loglevel' fixture
# that activates the internal logging
@ -52,6 +53,7 @@ def tractor_test(fn):
if 'start_method' in inspect.signature(fn).parameters:
# set of subprocess spawning backends
kwargs['start_method'] = start_method
return run(
partial(fn, *args, **kwargs),
arbiter_addr=arb_addr,