def print_diffs(text1, text2):
    lines1 = text1.splitlines(True)
    lines2 = text2.splitlines(True)
    diffs = difflib.unified_diff(lines1, lines2, n=0, fromfile='expected',
                                 tofile='got')
    print '\n' + ''.join(diffs)
Prints unified diffs for two texts
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/test/test_pydoc.py/print_diffs