vnpy/tests/test_all.py
nanoric 080f0cc131 [Mod] psql: use connection string
[Mod] test_all.py: return 1 if errors
2019-04-15 00:22:21 -04:00

32 lines
687 B
Python

# tests/runner.py
import unittest
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))
# initialize a runner, pass it your suite and run it
def main():
runner = unittest.TextTestRunner(verbosity=3)
result = runner.run(suite)
return result
if __name__ == '__main__':
result = main()
if result.failures or result.errors:
exit(1)
else:
exit(0)