Fairly subtle fix for failing tests.
This commit is contained in:
parent
8df511b5f6
commit
9b8850439c
|
@ -63,9 +63,9 @@ def _structure(msg, fp=None, level=0, include_default=False):
|
|||
if fp is None:
|
||||
fp = sys.stdout
|
||||
tab = ' ' * (level * 4)
|
||||
print(tab + msg.get_content_type(), end=' ', file=fp)
|
||||
print(tab + msg.get_content_type(), end='', file=fp)
|
||||
if include_default:
|
||||
print('[%s]' % msg.get_default_type(), file=fp)
|
||||
print(' [%s]' % msg.get_default_type(), file=fp)
|
||||
else:
|
||||
print(file=fp)
|
||||
if msg.is_multipart():
|
||||
|
|
|
@ -54,10 +54,9 @@ class TestEmailBase(unittest.TestCase):
|
|||
if first != second:
|
||||
sfirst = str(first)
|
||||
ssecond = str(second)
|
||||
diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines())
|
||||
fp = StringIO()
|
||||
print(NL, NL.join(diff), file=fp)
|
||||
raise self.failureException, fp.getvalue()
|
||||
diff = difflib.ndiff(sfirst.splitlines(True),
|
||||
ssecond.splitlines(True))
|
||||
raise self.failureException(NL + "".join(diff))
|
||||
|
||||
def _msgobj(self, filename):
|
||||
fp = openfile(findfile(filename))
|
||||
|
|
|
@ -55,10 +55,9 @@ class TestEmailBase(unittest.TestCase):
|
|||
if first != second:
|
||||
sfirst = str(first)
|
||||
ssecond = str(second)
|
||||
diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines())
|
||||
fp = StringIO()
|
||||
print(NL, NL.join(diff), file=fp)
|
||||
raise self.failureException, fp.getvalue()
|
||||
diff = difflib.ndiff(sfirst.splitlines(True),
|
||||
ssecond.splitlines(True))
|
||||
raise self.failureException(NL + "".join(diff))
|
||||
|
||||
def _msgobj(self, filename):
|
||||
fp = openfile(findfile(filename))
|
||||
|
|
Loading…
Reference in New Issue