diff --git a/src/py_func/handle.py b/src/py_func/handle.py index e27b13f..af4c7d5 100644 --- a/src/py_func/handle.py +++ b/src/py_func/handle.py @@ -6,8 +6,10 @@ import platform import math import json import traceback + from testium.interpreter.utils.jrpc import JsonRpcSrv from testium.interpreter.utils.tum_except import ETUMRuntimeError, print_exception +import py_func.tm as tm from py_func.func_call import func_exec diff --git a/src/testium/interpreter/test_items/test_item_lua_func.py b/src/testium/interpreter/test_items/test_item_lua_func.py index ef3cf6d..41a255a 100644 --- a/src/testium/interpreter/test_items/test_item_lua_func.py +++ b/src/testium/interpreter/test_items/test_item_lua_func.py @@ -46,9 +46,8 @@ class TestItemLuaFunc(TestItem): self.func_name = self._prms.expanse(self.func_name) param_list = self._prms.getParamFromList(self.params) pl = self._prms.expanse(param_list) - if tm.debug_enabled(): - tm.print_debug("Parameters list:") - tm.print_debug(textwrap.indent(pprint.pformat(pl), " |")) + print("Parameters list:") + print(textwrap.indent(pprint.pformat(pl), " |")) if self._proc is not None: self._proc.start() @@ -71,13 +70,11 @@ Is the lua environnment well defined in the "LUA_PATH" and "LUA_CPATH" variables if success == TestValue.SUCCESS: self.result.set(TestValue.SUCCESS) res, reported_values = ret - print(res) reported_values = {**reported_values, "returned": res} self.result.reported = ret[1] - if tm.debug_enabled(): - tm.print_debug("Returned value:") - tm.print_debug(textwrap.indent(pprint.pformat(res), " |")) + print("Returned value:") + print(textwrap.indent(pprint.pformat(res), " |")) # The result of the func test item is put in global dir and result tm.setgd("lfn_" + self._name, res) @@ -85,9 +82,9 @@ Is the lua environnment well defined in the "LUA_PATH" and "LUA_CPATH" variables else: self.result.set(TestValue.FAILURE, ret) - if tm.debug_enabled(): - tm.print_debug("Failed:") - tm.print_debug(textwrap.indent(pprint.pformat(ret), " |")) + + print("Failed!") + tm.print_debug(textwrap.indent(pprint.pformat(ret), " |")) return diff --git a/src/testium/interpreter/test_items/test_item_py_func.py b/src/testium/interpreter/test_items/test_item_py_func.py index 0e8ae6c..dcd1bc4 100644 --- a/src/testium/interpreter/test_items/test_item_py_func.py +++ b/src/testium/interpreter/test_items/test_item_py_func.py @@ -44,9 +44,8 @@ class TestItemPyFunc(TestItem): self.func_name = self._prms.expanse(self.func_name) param_list = self._prms.getParamFromList(self.params) pl = self._prms.expanse(param_list) - if tm.debug_enabled(): - tm.print_debug("Parameters list:") - tm.print_debug(textwrap.indent(pprint.pformat(pl), " |")) + print("Parameters list:") + print(textwrap.indent(pprint.pformat(pl), " |")) # start the process for executing external python self._py_func_proc.start() @@ -68,10 +67,8 @@ python_bin = {tm.gd("python_bin", "no python path defined")}""" res, reported_values = ret reported_values = {**reported_values, "returned": res} self.result.reported = ret[1] - - if tm.debug_enabled(): - tm.print_debug("Returned value:") - tm.print_debug(textwrap.indent(pprint.pformat(res), " |")) + print("Returned value:") + print(textwrap.indent(pprint.pformat(res), " |")) # The result of the func test item is put in global dir and result tm.setgd("pfn_" + self._name, res) @@ -79,9 +76,8 @@ python_bin = {tm.gd("python_bin", "no python path defined")}""" else: self.result.set(TestValue.FAILURE, ret) - if tm.debug_enabled(): - tm.print_debug("Failed:") - tm.print_debug(textwrap.indent(pprint.pformat(ret), " |")) + print("Failed!") + tm.print_debug(textwrap.indent(pprint.pformat(ret), " |")) return diff --git a/src/testium/interpreter/utils/py_process.py b/src/testium/interpreter/utils/py_process.py index 44a65d0..99ca473 100644 --- a/src/testium/interpreter/utils/py_process.py +++ b/src/testium/interpreter/utils/py_process.py @@ -138,7 +138,7 @@ class PyProcessBase: sock.close() # Add the path of the subprocess (root sources of testium) - func_proc_path = testium_path() + func_proc_path = os.path.realpath(os.path.join(testium_path(), "..")) env["PYTHONPATH"] = func_proc_path + os.pathsep + self._ppath + os.pathsep + env.get("PYTHONPATH", "") params = [