add the exception to the result for script unit tests

This commit is contained in:
jasquat 2022-09-28 10:49:16 -04:00
parent 121f42f2cb
commit df8ef2e429
1 changed files with 8 additions and 1 deletions

View File

@ -37,7 +37,14 @@ class ScriptUnitTestRunner:
) -> ScriptUnitTestResult:
"""Run_task."""
task.data = input_context
cls._script_engine.execute(task, script)
try:
cls._script_engine.execute(task, script)
except Exception as ex:
return ScriptUnitTestResult(
result=False,
error=f"Failed to execute script: {str(ex)}",
)
result_as_boolean = task.data == expected_output_context
script_unit_test_result = ScriptUnitTestResult(