Fix: Missing newline makes tests fail

This commit is contained in:
Mauro Regli
2023-05-12 07:59:44 +02:00
committed by Mauro
parent 0ae9884836
commit 7c8dd7362d
+10 -6
View File
@@ -3,25 +3,25 @@ Test library.
""" """
import difflib import difflib
import http.server
import inspect import inspect
import json import json
import subprocess
import os import os
import posixpath import posixpath
import pprint
import re import re
import shlex import shlex
import shutil import shutil
import socketserver
import string import string
import subprocess
import threading import threading
import urllib.error import urllib.error
import urllib.parse import urllib.parse
import urllib.request import urllib.request
import pprint
import socketserver
import http.server
from uuid import uuid4
from pathlib import Path
import zlib import zlib
from pathlib import Path
from uuid import uuid4
def ungzip_if_required(output): def ungzip_if_required(output):
@@ -458,6 +458,10 @@ class BaseTest(object):
a = match_prepare(a) a = match_prepare(a)
b = match_prepare(b) b = match_prepare(b)
# strip trailing whitespace and newlines
a = a.strip()
b = b.strip()
if a != b: if a != b:
diff = "".join(difflib.unified_diff( diff = "".join(difflib.unified_diff(
[l + "\n" for l in a.split("\n")], [l + "\n" for l in b.split("\n")])) [l + "\n" for l in a.split("\n")], [l + "\n" for l in b.split("\n")]))