Commit 5034f07a authored by Nick Østergaard's avatar Nick Østergaard Committed by Brian Sidebotham

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

parent e4a5f248
import unittest import unittest
import platform import platform
import sys
if platform.python_version() < '2.7': if platform.python_version() < '2.7':
unittest = __import__('unittest2') unittest = __import__('unittest2')
...@@ -8,6 +9,10 @@ else: ...@@ -8,6 +9,10 @@ else:
if __name__ == '__main__': if __name__ == '__main__':
testsuite = unittest.TestLoader().discover('testcases',pattern="*.py") 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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment