Commit d8a8c7d8 authored by Alexandre Vassalotti's avatar Alexandre Vassalotti

Fix issue #1530.

Return an error exit status if not all tests passes.
parent 901464f1
...@@ -2657,12 +2657,15 @@ def _test(): ...@@ -2657,12 +2657,15 @@ def _test():
sys.path.insert(0, dirname) sys.path.insert(0, dirname)
m = __import__(filename[:-3]) m = __import__(filename[:-3])
del sys.path[0] del sys.path[0]
testmod(m) failures, _ = testmod(m)
else: else:
testfile(filename, module_relative=False) failures, _ = testfile(filename, module_relative=False)
if failures:
return 1
else: else:
r = unittest.TextTestRunner() r = unittest.TextTestRunner()
r.run(DocTestSuite()) r.run(DocTestSuite())
return 0
if __name__ == "__main__": if __name__ == "__main__":
_test() sys.exit(_test())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment