Do you know any library that will help doing that?
I would write a function that prints the differences between two multiline strings in the unified diff format. Somethi
This is how I solved:
def _unidiff_output(expected, actual):
"""
Helper function. Returns a string containing the unified diff of two multiline strings.
"""
import difflib
expected=expected.splitlines(1)
actual=actual.splitlines(1)
diff=difflib.unified_diff(expected, actual)
return ''.join(diff)
Did you have a look at the built-in python module difflib? Have a look that this example