forked from goodboy/tractor
Importing happens once locally now so expect a local error
parent
3c86aa2ab5
commit
e1a55a6f4f
|
@ -60,7 +60,7 @@ def test_rpc_errors(arb_addr, to_call, testdir):
|
||||||
if exposed_mods == ['tmp_mod']:
|
if exposed_mods == ['tmp_mod']:
|
||||||
# create an importable module with a bad import
|
# create an importable module with a bad import
|
||||||
testdir.syspathinsert()
|
testdir.syspathinsert()
|
||||||
# module should cause raise a ModuleNotFoundError at import
|
# module should cause a raise of a ModuleNotFoundError at import
|
||||||
testdir.makefile('.py', tmp_mod=funcname)
|
testdir.makefile('.py', tmp_mod=funcname)
|
||||||
|
|
||||||
# no need to exposed module to the subactor
|
# no need to exposed module to the subactor
|
||||||
|
@ -69,7 +69,9 @@ def test_rpc_errors(arb_addr, to_call, testdir):
|
||||||
func_defined = False
|
func_defined = False
|
||||||
# subactor should not try to invoke anything
|
# subactor should not try to invoke anything
|
||||||
subactor_requests_to = None
|
subactor_requests_to = None
|
||||||
remote_err = trio.MultiError
|
# the module will be attempted to be imported locally but will
|
||||||
|
# fail in the initial local instance of the actor
|
||||||
|
remote_err = inside_err
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
actor = tractor.current_actor()
|
actor = tractor.current_actor()
|
||||||
|
@ -100,7 +102,7 @@ def test_rpc_errors(arb_addr, to_call, testdir):
|
||||||
if exposed_mods and func_defined:
|
if exposed_mods and func_defined:
|
||||||
run()
|
run()
|
||||||
else:
|
else:
|
||||||
# underlying errors are propagated upwards (yet)
|
# underlying errors aren't propagated upwards (yet)
|
||||||
with pytest.raises(remote_err) as err:
|
with pytest.raises(remote_err) as err:
|
||||||
run()
|
run()
|
||||||
|
|
||||||
|
@ -114,4 +116,5 @@ def test_rpc_errors(arb_addr, to_call, testdir):
|
||||||
value.exceptions
|
value.exceptions
|
||||||
))
|
))
|
||||||
|
|
||||||
|
if getattr(value, 'type', None):
|
||||||
assert value.type is inside_err
|
assert value.type is inside_err
|
||||||
|
|
Loading…
Reference in New Issue