Skip to content

Commit

Permalink
tests: adds diff to tests to find errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Nov 8, 2015
1 parent bc4495b commit ddc650e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clap-tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
import subprocess
import re
import difflib

failed = False

Expand Down Expand Up @@ -293,6 +294,9 @@ def pass_fail(name, cmd, check, good):
return 0
print('Fail')
print('\n\n{}\n# Should be:\n$ {}\n{}\n\n{}\n# But is:\n$ {}\n{}\n\n'.format('#'*25, cmd, good, '#'*25, cmd, check))
for line in difflib.context_diff(good.splitlines(), check.splitlines(), fromfile="Should Be", tofile="Currently Is", lineterm=""):
print(line)
print()
return 1


Expand Down

0 comments on commit ddc650e

Please sign in to comment.