From a5ca65291501caa3f916f374a0a5b0b15721978c Mon Sep 17 00:00:00 2001 From: Asher Glick Date: Thu, 9 Nov 2023 00:04:38 -0600 Subject: [PATCH] fixing the printed xml diff to have correct newlines --- xml_converter/intigration_tests/run_tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xml_converter/intigration_tests/run_tests.py b/xml_converter/intigration_tests/run_tests.py index 6238c448..8cc4d131 100755 --- a/xml_converter/intigration_tests/run_tests.py +++ b/xml_converter/intigration_tests/run_tests.py @@ -51,9 +51,9 @@ def run_xml_converter( def compare_text_files(file_path1: str, file_path2: str) -> List[str]: with open(file_path1, 'r') as file1: - content1 = file1.readlines() + content1 = file1.read().split("\n") with open(file_path2, 'r') as file2: - content2 = file2.readlines() + content2 = file2.read().split("\n") diff = list(difflib.unified_diff(content1, content2, fromfile=file_path1, tofile=file_path2, lineterm="")) @@ -181,7 +181,7 @@ def main() -> None: if len_diff(xml_diff) != 0: print(f"XML output was incorrect for test {testcase.name}") for line in xml_diff: - print(line, end="") + print(line) all_tests_passed = False if testcase.expected_output_proto_path is not None: