summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJensDiemer <git@jensdiemer.de>2020-02-01 16:22:46 +0100
committerJensDiemer <git@jensdiemer.de>2020-02-01 16:22:46 +0100
commitf1abc0141a193abc457b0078f93a4213a218284a (patch)
treeed25a736687af19ebf959af105cc08018ae40e65
parent7bd4d0e96cc7b282e40b91b9bc5f8eb7355077f3 (diff)
downloadcreole-f1abc0141a193abc457b0078f93a4213a218284a.tar.gz
test_update_rst_readme(): work-a-round for CI run
-rw-r--r--creole/tests/test_setup_utils.py12
1 files 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}')