File: test_all.py

package info (click to toggle)
python-crontab 1.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 356 kB
  • ctags: 494
  • sloc: python: 1,520; makefile: 8; sh: 8
file content (11 lines) | stat: -rw-r--r-- 444 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
import glob
import unittest

if __name__ == '__main__':
    test_files = glob.glob('test_*.py')
    modules = [s[:-3] for s in test_files if 'compat' not in s]
    suites = [unittest.defaultTestLoader.loadTestsFromName(s) for s in modules]
    testSuite = unittest.TestSuite(suites)
    text_runner = unittest.TextTestRunner().run(testSuite)
    if text_runner.errors or text_runner.failures:
        raise SystemExit("Some unit tests failed")