summaryrefslogtreecommitdiffstats
path: root/Lib/doctest.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r--Lib/doctest.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index eb863cb..4a2da32 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -2651,12 +2651,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())