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

View File

@@ -3,25 +3,25 @@ Test library.
"""
import difflib
import http.server
import inspect
import json
import subprocess
import os
import posixpath
import pprint
import re
import shlex
import shutil
import socketserver
import string
import subprocess
import threading
import urllib.error
import urllib.parse
import urllib.request
import pprint
import socketserver
import http.server
from uuid import uuid4
from pathlib import Path
import zlib
from pathlib import Path
from uuid import uuid4
def ungzip_if_required(output):
@@ -458,6 +458,10 @@ class BaseTest(object):
a = match_prepare(a)
b = match_prepare(b)
# strip trailing whitespace and newlines
a = a.strip()
b = b.strip()
if a != b:
diff = "".join(difflib.unified_diff(
[l + "\n" for l in a.split("\n")], [l + "\n" for l in b.split("\n")]))