From 5034f07a31e9b41a4733fb02ec757f290055ae3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nick=20=C3=98stergaard?= Date: Sat, 25 Oct 2014 22:26:41 +0100 Subject: [PATCH] * Update the python qa test suite to exit with an error code if any errors fail --- qa/test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qa/test.py b/qa/test.py index 3a25976140..88ce7bd841 100644 --- a/qa/test.py +++ b/qa/test.py @@ -1,5 +1,6 @@ import unittest import platform +import sys if platform.python_version() < '2.7': unittest = __import__('unittest2') @@ -8,6 +9,10 @@ else: if __name__ == '__main__': testsuite = unittest.TestLoader().discover('testcases',pattern="*.py") - unittest.TextTestRunner(verbosity=100).run(testsuite) + results = unittest.TextTestRunner(verbosity=100).run(testsuite) + + # Return an error code if any of the testsuite tests fail + if len(results.errors) > 0: + sys.exit(1)