diff --git a/bob/extension/test_click_helper.py b/bob/extension/test_click_helper.py index 2cf8925127283101ce0b8b1a908e0d4b58adabf4..7a40549fcf39d17605cd46a87c325945cd7d4b5d 100644 --- a/bob/extension/test_click_helper.py +++ b/bob/extension/test_click_helper.py @@ -191,11 +191,15 @@ def _assert_config_dump(ref, ref_date): # open(ref, 'wt').write(open('TEST_CONF').read()) with open("TEST_CONF", "r") as f, open(ref, "r") as f2: text = f.read() - ref_text = f2.read().replace(ref_date, today) - # remove the starting whitespace of each line so the tests are more relaxed - text = "\n".join(line.lstrip() for line in text.splitlines()) - ref_text = "\n".join(line.lstrip() for line in ref_text.splitlines()) - assert text == ref_text + ref_text = f2.read() + ref_text = ref_text.replace(ref_date, today) + # remove the starting and final whitespace of each line so the tests are more relaxed + text = "\n".join(line.strip() for line in text.splitlines()) + ref_text = "\n".join(line.strip() for line in ref_text.splitlines()) + # replace ''' with """ so tests are more relaxed + text = text.replace("'''", '"""') + ref_text = ref_text.replace("'''", '"""') + assert text == ref_text def test_config_dump():