From f1abc0141a193abc457b0078f93a4213a218284a Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Sat, 1 Feb 2020 16:22:46 +0100 Subject: test_update_rst_readme(): work-a-round for CI run --- creole/tests/test_setup_utils.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/creole/tests/test_setup_utils.py b/creole/tests/test_setup_utils.py index 3ef712a..5a7b366 100644 --- a/creole/tests/test_setup_utils.py +++ b/creole/tests/test_setup_utils.py @@ -123,15 +123,21 @@ def test_update_rst_readme(): if filecmp.cmp(rest_readme_path, old_rest_readme_path, shallow=False) is True: return + # On CI the file modification time maybe not the same. + # So skip the last line and compare again. + with old_rest_readme_path.open('r') as f: - from_file = [line.rstrip() for line in f] + from_file = [line.rstrip() for line in f][:-1] with rest_readme_path.open('r') as f: - to_tile = [line.rstrip() for line in f] + to_file = [line.rstrip() for line in f][:-1] + + if from_file == to_file: + return diff = '\n'.join( line - for line in difflib.Differ().compare(from_file, to_tile) + for line in difflib.Differ().compare(from_file, to_file) if line[0] != ' ' ) raise AssertionError(f'README.rst is not up-to-date:\n{diff}') -- cgit v1.2.1