From b40a7c6a9f28903bf9972bcf1e562e55fc688617 Mon Sep 17 00:00:00 2001 From: Frederic Peters Date: Sun, 25 Jul 2004 12:43:57 +0000 Subject: nozero exit code if a test failed --- python/tests/tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'python/tests') diff --git a/python/tests/tests.py b/python/tests/tests.py index de359ee5..644135eb 100755 --- a/python/tests/tests.py +++ b/python/tests/tests.py @@ -38,6 +38,7 @@ testSuites = ( 'login_tests', ) +success = True for testSuite in testSuites: fp, pathname, description = imp.find_module(testSuite) try: @@ -58,5 +59,8 @@ for testSuite in testSuites: print doc print '-' * len(doc) - unittest.TextTestRunner(verbosity=2).run(module.allTests) + result = unittest.TextTestRunner(verbosity=2).run(module.allTests) + success = success and result.wasSuccessful() + +sys.exit(not success) -- cgit