From e1a55a6f4f5ca60968ea27c2f0f1fb04946fc819 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 20 Jan 2020 13:41:08 -0500 Subject: [PATCH] Importing happens once locally now so expect a local error --- tests/test_rpc.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_rpc.py b/tests/test_rpc.py index 5dec131..0258f35 100644 --- a/tests/test_rpc.py +++ b/tests/test_rpc.py @@ -60,7 +60,7 @@ def test_rpc_errors(arb_addr, to_call, testdir): if exposed_mods == ['tmp_mod']: # create an importable module with a bad import 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) # no need to exposed module to the subactor @@ -69,7 +69,9 @@ def test_rpc_errors(arb_addr, to_call, testdir): func_defined = False # subactor should not try to invoke anything 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(): actor = tractor.current_actor() @@ -100,7 +102,7 @@ def test_rpc_errors(arb_addr, to_call, testdir): if exposed_mods and func_defined: run() else: - # underlying errors are propagated upwards (yet) + # underlying errors aren't propagated upwards (yet) with pytest.raises(remote_err) as err: run() @@ -114,4 +116,5 @@ def test_rpc_errors(arb_addr, to_call, testdir): value.exceptions )) - assert value.type is inside_err + if getattr(value, 'type', None): + assert value.type is inside_err