Skip to content

Instantly share code, notes, and snippets.

@curzona
Created October 2, 2015 08:30
Show Gist options
  • Save curzona/ad5d45fc22bf07a13256 to your computer and use it in GitHub Desktop.
Save curzona/ad5d45fc22bf07a13256 to your computer and use it in GitHub Desktop.
def assert_file_equal(a, b):
a = open(a, "rb").read()
b = open(b, "rb").read()
if a != b:
diff = difflib.ndiff(a.splitlines(True),
b.splitlines(True))
message = ''.join(diff)
raise AssertionError("Not equal:\n" + message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment