2017-09-11 23:44:19 +00:00
|
|
|
import os.path
|
|
|
|
import sys
|
2017-03-30 14:59:06 +00:00
|
|
|
import unittest
|
2017-09-11 23:44:19 +00:00
|
|
|
import unittest.runner
|
2017-03-30 14:59:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
def suite():
|
|
|
|
test_loader = unittest.TestLoader()
|
2017-09-11 23:44:19 +00:00
|
|
|
test_suite = test_loader.discover(
|
|
|
|
os.path.dirname(__file__), pattern='test_*.py')
|
2017-03-30 14:59:06 +00:00
|
|
|
return test_suite
|
2017-09-11 23:44:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
runner = unittest.runner.TextTestRunner()
|
|
|
|
result = runner.run(suite())
|
|
|
|
sys.exit(not result.wasSuccessful())
|