def compare_output_files_error_lines_only( file_out: str, file_exp: str ) -> Tuple[bool, str]: out = "" failed = False try: errors_out = parse_errors(file_out) errors_exp = parse_errors(file_exp) ( errors_in_exp_not_in_out, errors_in_out_not_in_exp, ) = compare_errors_by_line_no(errors_out=errors_out, errors_exp=errors_exp) failed = bool(errors_in_exp_not_in_out) or bool(errors_in_out_not_in_exp) if errors_in_exp_not_in_out: out += f"""\033[93mExpected errors which were not produced:\033[0m {sprint_errors(errors_in_exp_not_in_out)} """ if errors_in_out_not_in_exp: out += f"""\033[93mProduced errors which were not expected:\033[0m {sprint_errors(errors_in_out_not_in_exp)} """ except IOError as e: out = f"Warning: {e}" return (failed, out)
def compare_output_files_error_lines_only(file_out: str, file_exp: str): out = '' failed = False try: errors_out = parse_errors(file_out) errors_exp = parse_errors(file_exp) (errors_in_exp_not_in_out, errors_in_out_not_in_exp) = \ compare_errors_by_line_no(errors_out=errors_out, errors_exp=errors_exp) failed = errors_in_exp_not_in_out or errors_in_out_not_in_exp if errors_in_exp_not_in_out: out += f"""\033[93mExpected errors which were not produced:\033[0m {sprint_errors(errors_in_exp_not_in_out)} """ if errors_in_out_not_in_exp: out += f"""\033[93mProduced errors which were not expected:\033[0m {sprint_errors(errors_in_out_not_in_exp)} """ except IOError as e: out = f'Warning: {e}' return (failed, out)
def compare_output_files_error_lines_only(file_out: str, file_exp: str): out = '' failed = False try: errors_out = parse_errors(file_out) errors_exp = parse_errors(file_exp) (errors_in_exp_not_in_out, errors_in_out_not_in_exp) = \ compare_errors_by_line_no(errors_out=errors_out, errors_exp=errors_exp) failed = errors_in_exp_not_in_out or errors_in_out_not_in_exp if errors_in_exp_not_in_out: out += f"""\033[93mExpected errors which were not produced:\033[0m {sprint_errors(errors_in_exp_not_in_out)} """ if errors_in_out_not_in_exp: out += f"""\033[93mProduced errors which were not expected:\033[0m {sprint_errors(errors_in_out_not_in_exp)} """ except IOError as e: out = f'Warning: {e}' return (failed, out)