vnpy/tests/test_all.py

32 lines
687 B
Python
Raw Permalink Normal View History

# tests/runner.py
import unittest
2019-04-14 09:58:18 +00:00
import app
# 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
# 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()
if result.failures or result.errors:
2019-04-14 09:58:18 +00:00
exit(1)
else:
exit(0)