Skip to content

Instantly share code, notes, and snippets.

@abhinavsingh
Created July 15, 2013 16:39
Show Gist options
  • Save abhinavsingh/6001428 to your computer and use it in GitHub Desktop.
Save abhinavsingh/6001428 to your computer and use it in GitHub Desktop.
Run test suite prepared using various test files
# -*- coding: utf-8 -*-
"""
run_tests
~~~~~~~~~
Run test suite prepared using various test files
"""
import os
import glob
import unittest
def main():
tests = glob.glob('tests/test_*.py')
modules = [os.path.splitext(test)[0] for test in tests]
suites = [unittest.defaultTestLoader.loadTestsFromName(module.replace('/', '.')) for module in modules]
unittest.TextTestRunner().run(unittest.TestSuite(suites))
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment