summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2007-12-08 04:49:22 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2007-12-08 04:49:22 (GMT)
commitd8a8c7d8d754ca965e6d04265ec034001bf7b50b (patch)
treee47366aa9ad2ad21d79237d8d11495173bf942f4 /Lib
parent901464f13118fa6abfd402c5fde4df8f5788f7c6 (diff)
downloadcpython-d8a8c7d8d754ca965e6d04265ec034001bf7b50b.zip
cpython-d8a8c7d8d754ca965e6d04265ec034001bf7b50b.tar.gz
cpython-d8a8c7d8d754ca965e6d04265ec034001bf7b50b.tar.bz2
Fix issue #1530.
Return an error exit status if not all tests passes.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/doctest.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index 5ba2d2d..e8bd534 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -2657,12 +2657,15 @@ def _test():
sys.path.insert(0, dirname)
m = __import__(filename[:-3])
del sys.path[0]
- testmod(m)
+ failures, _ = testmod(m)
else:
- testfile(filename, module_relative=False)
+ failures, _ = testfile(filename, module_relative=False)
+ if failures:
+ return 1
else:
r = unittest.TextTestRunner()
r.run(DocTestSuite())
+ return 0
if __name__ == "__main__":
- _test()
+ sys.exit(_test())