From 691c64405932270dc1213731de308dadd981d5e9 Mon Sep 17 00:00:00 2001 From: surister Date: Sat, 21 Dec 2019 23:42:12 +0100 Subject: [PATCH] Error bulk rather than single error exit --- tests/syntax_checker.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/syntax_checker.py b/tests/syntax_checker.py index 31b7223..6ee9ced 100644 --- a/tests/syntax_checker.py +++ b/tests/syntax_checker.py @@ -68,11 +68,12 @@ def check_details_tag(file_list): after_detail = True if b'' in line and after_detail: - after_detail = False if error: - raise Exception(err_message) + errors.append(err_message) + + error = False def check_summary_tag(file_list): @@ -107,10 +108,17 @@ def check_summary_tag(file_list): after_summary = False if error: - raise Exception(err_message) + errors.append(err_message) + + error = False if __name__ == '__main__': check_details_tag(file_list) check_summary_tag(file_list) - print("tests passed successfully") + if errors: + for error in errors: + print(error) + exit(1) + + print("Tests passed successfully.")