From 2aab49b09ea496307413c44c7a32f3a7f3e8c952 Mon Sep 17 00:00:00 2001 From: "John M. Schanck" Date: Fri, 23 Oct 2020 10:00:50 -0400 Subject: [PATCH] duplicate_consistency: strip spaces before comparison --- test/test_duplicate_consistency.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/test_duplicate_consistency.py b/test/test_duplicate_consistency.py index 2876569b..a5967151 100644 --- a/test/test_duplicate_consistency.py +++ b/test/test_duplicate_consistency.py @@ -62,17 +62,17 @@ def test_duplicate_consistency(implementation, source, files): for file in files: target_path = os.path.join(source.path(), file) this_path = os.path.join(implementation.path(), file) - target_src = file_get_contents(target_path) - this_src = file_get_contents(this_path) - this_transformed_src = this_src.replace( - implementation.namespace_prefix(), '') - target_transformed_src = target_src.replace( - source.namespace_prefix(), '') + target_src = file_get_contents(target_path)\ + .replace(source.namespace_prefix(), '')\ + .replace(' ', '') + this_src = file_get_contents(this_path)\ + .replace(implementation.namespace_prefix(), '')\ + .replace(' ', '') - if not this_transformed_src == target_transformed_src: + if not this_src == target_src: diff = difflib.unified_diff( - this_transformed_src.splitlines(keepends=True), - target_transformed_src.splitlines(keepends=True), + this_src.splitlines(keepends=True), + target_src.splitlines(keepends=True), fromfile=this_path, tofile=target_path) messages.append("{} differed:\n{}".format(file, ''.join(diff)))