forked from goodboy/tractor
Running without a main func is a type error
parent
914d1b67d8
commit
0ca668453c
|
@ -8,6 +8,9 @@ import trio
|
||||||
import tractor
|
import tractor
|
||||||
|
|
||||||
|
|
||||||
|
from conftest import tractor_test
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.trio
|
@pytest.mark.trio
|
||||||
async def test_no_arbitter():
|
async def test_no_arbitter():
|
||||||
"""An arbitter must be established before any nurseries
|
"""An arbitter must be established before any nurseries
|
||||||
|
@ -21,6 +24,13 @@ async def test_no_arbitter():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def test_no_main():
|
||||||
|
"""An async function **must** be passed to ``tractor.run()``.
|
||||||
|
"""
|
||||||
|
with pytest.raises(TypeError):
|
||||||
|
tractor.run(None)
|
||||||
|
|
||||||
|
|
||||||
def test_local_actor_async_func(arb_addr):
|
def test_local_actor_async_func(arb_addr):
|
||||||
"""Verify a simple async function in-process.
|
"""Verify a simple async function in-process.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -43,7 +43,7 @@ async def _main(
|
||||||
"""Async entry point for ``tractor``.
|
"""Async entry point for ``tractor``.
|
||||||
"""
|
"""
|
||||||
log = get_logger('tractor')
|
log = get_logger('tractor')
|
||||||
main = partial(async_fn, *args) if async_fn else None
|
main = partial(async_fn, *args)
|
||||||
arbiter_addr = (host, port) = arbiter_addr or (
|
arbiter_addr = (host, port) = arbiter_addr or (
|
||||||
_default_arbiter_host, _default_arbiter_port)
|
_default_arbiter_host, _default_arbiter_port)
|
||||||
get_console_log(kwargs.get('loglevel', get_loglevel()))
|
get_console_log(kwargs.get('loglevel', get_loglevel()))
|
||||||
|
|
Loading…
Reference in New Issue