From 8141a3496d1e415f119ec413625afd0131fa4a1a Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 30 Dec 2009 11:26:22 +0000 Subject: [PATCH] call sys.exit() with doctest failure results --- terminatorlib/borg.py | 3 ++- terminatorlib/config.py | 2 ++ terminatorlib/plugin.py | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/terminatorlib/borg.py b/terminatorlib/borg.py index 3e4233cf..ec9d3770 100755 --- a/terminatorlib/borg.py +++ b/terminatorlib/borg.py @@ -100,7 +100,8 @@ if __name__ == '__main__': if not self.attribute: self.attribute = 1 + import sys import doctest (failed, attempted) = doctest.testmod() print "%d/%d tests failed" % (failed, attempted) - + sys.exit(failed) diff --git a/terminatorlib/config.py b/terminatorlib/config.py index 0d20ee1a..c81470f9 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -427,6 +427,8 @@ class ConfigBase(Borg): return(True) if __name__ == '__main__': + import sys import doctest (failed, attempted) = doctest.testmod() print "%d/%d tests failed" % (failed, attempted) + sys.exit(failed) diff --git a/terminatorlib/plugin.py b/terminatorlib/plugin.py index 7c3d1fdf..d664f86b 100755 --- a/terminatorlib/plugin.py +++ b/terminatorlib/plugin.py @@ -106,8 +106,9 @@ for %s' % (len(self.instances), capability)) return(self.instances) if __name__ == '__main__': + import sys import doctest sys.path.insert(0, 'plugins') (failed, attempted) = doctest.testmod() print "%d/%d tests failed" % (failed, attempted) - + sys.exit(failed)