handle encoding properly when outputting diff
This commit is contained in:
@@ -26,11 +26,13 @@ def _diff(old, new, desc):
|
||||
|
||||
raise AssertionError(
|
||||
("\nError while comparing strings:\n"
|
||||
"%s") % (output, ))
|
||||
"%s") % (output.encode('utf-8'), ))
|
||||
|
||||
|
||||
def diffStrings(orig, new, desc='input'):
|
||||
|
||||
assert type(orig) == type(new)
|
||||
|
||||
def _tolines(s):
|
||||
return [line + '\n' for line in s.split('\n')]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user