| import unittest2 as unittest |
| current_path = os.path.abspath(os.path.dirname(__file__)) |
| tests_path = os.path.join(current_path, 'tests') |
| all_tests = [f[:-3] for f in os.listdir(tests_path) |
| if f.startswith('test_') and f.endswith(".py")] |
| suite = unittest.TestSuite() |
| loader = unittest.TestLoader() |
| suite.addTest(loader.loadTestsFromName(test)) |
| if __name__ == '__main__': |
| $ python run_tests.py app |
| To run a couple of tests: |
| $ python run_tests.py app config sessions |
| $ coverage run run_tests.py |
| tests = ['%s' % t for t in tests] |
| unittest.TextTestRunner(verbosity=2).run(suite) |