* Update the python qa test suite to exit with an error code if any errors fail

This commit is contained in:
Nick Østergaard 2014-10-25 22:26:41 +01:00 committed by Brian Sidebotham
parent e4a5f2482e
commit 5034f07a31
1 changed files with 6 additions and 1 deletions

View File

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