You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.0 KiB

From fb1fc865000c92fc431a04d54116001c35ec0cdd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl>
Date: Fri, 21 Dec 2012 00:29:53 +0100
Subject: [PATCH] Exit with failure when doctests fail.
---
documentation.py | 3 ++-
documentation3.py | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/documentation.py b/documentation.py
index 3d5a5c0..0ddd681 100644
--- a/documentation.py
+++ b/documentation.py
@@ -1131,4 +1131,5 @@ def hello(user):
print('hello %s' % user)
if __name__ == '__main__':
- import doctest; doctest.testmod()
+ import doctest
+ sys.exit(0 if doctest.testmod()[0] == 0 else 1)
diff --git a/documentation3.py b/documentation3.py
index bd86cc6..4162d56 100644
--- a/documentation3.py
+++ b/documentation3.py
@@ -1167,4 +1167,5 @@ def hello(user):
print('hello %s' % user)
if __name__ == '__main__':
- import doctest; doctest.testmod()
+ import doctest
+ sys.exit(0 if doctest.testmod()[0] == 0 else 1)
--
1.8.0.2