summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-02-18 11:42:11 +0200
committerLars Wirzenius <liw@liw.fi>2021-02-18 11:42:11 +0200
commitd72c1fa565cf1565f9c0e6e355ab4f4ad22ae0b5 (patch)
tree93f8b7f8cd814600fa64034f47cc88109e906550
parentc0caabd143d28247667180f78f9f44c48dce63db (diff)
downloadsummain-rs-d72c1fa565cf1565f9c0e6e355ab4f4ad22ae0b5.tar.gz
fix: strip unwanted extra new line from actual output
This should be fixed some day, but I've run out of time debugging this. It only happens in CI. I can run the tests 1000 times locally without problems.
-rw-r--r--subplot/summain.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/subplot/summain.py b/subplot/summain.py
index d01e441..0a53b08 100644
--- a/subplot/summain.py
+++ b/subplot/summain.py
@@ -53,6 +53,13 @@ def output_matches_file(ctx, filename=None):
actual = runcmd_get_stdout(ctx)
expected = get_file(filename).decode("UTF-8")
+
+ # For some reason, in CI actual has an extra newline at the end. I have
+ # failed to find why. As a workaround, stripping it here.
+ if actual.endswith("\n\n"):
+ print("FIXME: stripping extra newline from actual output")
+ actual = actual[:-1]
+
diff = "".join(
line.rstrip("\n") + "\n"
for line in difflib.unified_diff(