Skip to content

Commit

Permalink
Exit with code 0 or 1
Browse files Browse the repository at this point in the history
Using the number of failed tests as the exit code results in exit code
0 if a multiple of 256 tests fail.  Fixes github PR#10, but in a
slightly different way.
  • Loading branch information
ojwb committed Jul 7, 2015
1 parent d886a25 commit d9a3558
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
else:
num_failures, num_tests = doctest.testfile('docs/quickstart.txt')

sys.exit(num_failures)
if num_failures > 0:
print("%d failures out of %d tests" % (num_failures, num_tests))
sys.exit(1)

sys.exit(0)

0 comments on commit d9a3558

Please sign in to comment.