Skip to content

Commit 42cd4d9

Browse files
committed
Exit with 1 if any doctests fail.
1 parent 38a6d0a commit 42cd4d9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/doctest

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ if len(sys.argv) == 1:
1818
else:
1919
modules = sys.argv[1:]
2020

21+
exit_code = 0
2122
# for each module
2223
for module_path in modules:
2324
print "Testing " + module_path
24-
doctest.testfile(module_path, module_relative=False)
25+
failure_count, test_count = doctest.testfile(module_path, module_relative=False)
26+
if failure_count and exit_code == 0:
27+
exit_code = 1
28+
29+
sys.exit(exit_code)

0 commit comments

Comments
 (0)