From 0d8165313136842e7ee86da6395225939722c976 Mon Sep 17 00:00:00 2001 From: surister Date: Sat, 21 Dec 2019 22:57:37 +0100 Subject: [PATCH] correct error message --- tests/syntax_checker.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/syntax_checker.py b/tests/syntax_checker.py index e135510..17b6b74 100644 --- a/tests/syntax_checker.py +++ b/tests/syntax_checker.py @@ -60,18 +60,18 @@ def check_details_tag(file_list): if b'
' in line and after_detail: error = True if b'
' in line and not after_detail: - err_message = 'Missing opening detail tag' + err_message = f'Missing opening detail tag at line {line_number}' error = True if b'
' in line: after_detail = True if b'
' in line and after_detail: - err_message = 'Missing closing detail tag' + err_message = f'Missing closing detail tag at line {line_number}' after_detail = False if error: - raise Exception(f'{err_message} at line {line_number -1}') + raise Exception(err_message) def check_summary_tag(file_list): @@ -95,18 +95,18 @@ def check_summary_tag(file_list): if b'' in line and after_detail: error = True if b'' in line and not after_detail: - err_message = 'Missing opening detail tag' + err_message = f'Missing opening summary tag at line {line_number}' error = True if b'' in line: after_detail = True if b'' in line and after_detail: - err_message = 'Missing closing detail tag' + err_message = f'Missing closing summary tag at line {line_number}' after_detail = False if error: - raise Exception(f'{err_message} at line {line_number -3}') + raise Exception(err_message) if __name__ == '__main__':