diff --git a/src/testium/interpreter/test_set.py b/src/testium/interpreter/test_set.py index 03643de..4c97229 100644 --- a/src/testium/interpreter/test_set.py +++ b/src/testium/interpreter/test_set.py @@ -320,19 +320,18 @@ class TestSet: def set_post_exec(self): post_exec = self._testdict.get("post_execution", None) if post_exec is None: - if self.post_exec_file is not None: - self.post_exec_file = None + self.post_exec_file = None return postexec_file = post_exec["file_name"] - if not os.path.isfile(os.path.join(self._testDir, postexec_file)): + if not os.path.isfile(os.path.join(tm.gd("test_directory"), postexec_file)): raise ETUMSyntaxError(f"Post execution file '{postexec_file}' not found") self.post_exec_file = postexec_file def run_post_exec(self): - + tm.print_debug("Is there a post execution file ?") post_exec_file = self.post_exec_file test_dir = tm.gd("test_directory") diff --git a/test/validation/post_execution.py b/test/validation/post_execution.py index 71d8b17..b0ae4df 100644 --- a/test/validation/post_execution.py +++ b/test/validation/post_execution.py @@ -3,7 +3,6 @@ import py_func.tm as tm import textwrap import sqlite3 from junit_xml import TestSuite, TestCase -from interpreter.test_items.test_result import TestValue def _prepare_file_to_save(file_name, file_ext=""): @@ -36,10 +35,10 @@ def _get_testSuite(test, cur): ) # Check the results of all - if result[1] == str(TestValue.NORUN): + if result[1] == "SKIP": tc.add_skipped_info("The test has not being runned") elif result[2] == f"{test}_PASS": - if result[1] == str(TestValue.FAILURE): + if result[1] == "FAIL": failures += 1 print(f"Item [{test}] Failing on '{result[0]}' : The test should PASS") print("*" * 80) @@ -47,7 +46,7 @@ def _get_testSuite(test, cur): print("*" * 80) tc.add_error_info("The test should PASS!\n\n" + result[4]) elif result[2] == f"{test}_FAIL": - if result[1] == str(TestValue.SUCCESS): + if result[1] == "PASS": failures += 1 print( f"Item [{test}] Failing on '{result[0]}' : \n\tThe test should FAIL"