Created
July 15, 2013 16:39
-
-
Save abhinavsingh/6001428 to your computer and use it in GitHub Desktop.
Run test suite prepared using various test files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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