You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
439 B

  1. import unittest
  2. import platform
  3. import sys
  4. if platform.python_version() < '2.7':
  5. unittest = __import__('unittest2')
  6. else:
  7. import unittest
  8. if __name__ == '__main__':
  9. testsuite = unittest.TestLoader().discover('testcases',pattern="*.py")
  10. results = unittest.TextTestRunner(verbosity=100).run(testsuite)
  11. # Return an error code if any of the testsuite tests fail
  12. if not results.wasSuccessful():
  13. sys.exit(1)