topotests: change from "context" to "unified" diff

context diff:
*** before.py
This commit is contained in:
David Lamparter 2017-08-09 19:08:50 +02:00 committed by Donald Sharp
parent 5684f8100d
commit 91733ef85e

View File

@ -201,7 +201,7 @@ def pid_exists(pid):
def get_textdiff(text1, text2, title1="", title2=""): def get_textdiff(text1, text2, title1="", title2=""):
"Returns empty string if same or formatted diff" "Returns empty string if same or formatted diff"
diff = '\n'.join(difflib.context_diff(text1, text2, diff = '\n'.join(difflib.unified_diff(text1, text2,
fromfile=title1, tofile=title2)) fromfile=title1, tofile=title2))
# Clean up line endings # Clean up line endings
diff = os.linesep.join([s for s in diff.splitlines() if s]) diff = os.linesep.join([s for s in diff.splitlines() if s])