2019-04-14 03:02:30 +00:00
|
|
|
# tests/runner.py
|
|
|
|
import unittest
|
|
|
|
|
2019-04-14 09:58:18 +00:00
|
|
|
import app
|
2019-04-14 03:02:30 +00:00
|
|
|
# import your test modules
|
|
|
|
import test_import_all
|
|
|
|
import trader
|
|
|
|
|
|
|
|
# initialize the test suite
|
|
|
|
loader = unittest.TestLoader()
|
|
|
|
suite = unittest.TestSuite()
|
|
|
|
|
|
|
|
# add tests to the test suite
|
|
|
|
suite.addTests(loader.loadTestsFromModule(test_import_all))
|
|
|
|
suite.addTests(loader.loadTestsFromModule(trader))
|
|
|
|
suite.addTests(loader.loadTestsFromModule(app))
|
|
|
|
|
2019-04-14 09:58:18 +00:00
|
|
|
|
2019-04-14 03:02:30 +00:00
|
|
|
# initialize a runner, pass it your suite and run it
|
2019-04-14 09:58:18 +00:00
|
|
|
def main():
|
|
|
|
runner = unittest.TextTestRunner(verbosity=3)
|
|
|
|
result = runner.run(suite)
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
result = main()
|
2019-04-15 04:22:21 +00:00
|
|
|
if result.failures or result.errors:
|
2019-04-14 09:58:18 +00:00
|
|
|
exit(1)
|
|
|
|
else:
|
|
|
|
exit(0)
|