2
# -*- coding: utf-8 -*-
6
import unittest2 as unittest
8
current_path = os.path.abspath(os.path.dirname(__file__))
9
tests_path = os.path.join(current_path, 'tests')
15
all_tests = [f[:-3] for f in os.listdir(tests_path)
16
if f.startswith('test_') and f.endswith(".py")]
20
suite = unittest.TestSuite()
21
loader = unittest.TestLoader()
23
suite.addTest(loader.loadTestsFromName(test))
26
if __name__ == '__main__':
31
$ python run_tests.py app
32
To run a couple of tests:
33
$ python run_tests.py app config sessions
35
$ coverage run run_tests.py
41
tests = ['%s' % t for t in tests]
42
suite = get_suite(tests)
43
unittest.TextTestRunner(verbosity=1).run(suite)