call sys.exit() with doctest failure results

This commit is contained in:
Chris Jones 2009-12-30 11:26:22 +00:00
parent a13581a4c8
commit 8141a3496d
3 changed files with 6 additions and 2 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)