Menu

[d1291f]: / test_all.py  Maximize  Restore  History

Download this file

26 lines (19 with data), 648 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'''
Just a small test creation script setting up the python environment and running
all collected tests from the tests directory.
'''
import sys
import os
import unittest
# make sure this path is used on imports
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from tests import test_suites
suite=unittest.TestSuite(test_suites.values())
# for pydev test runner
def load_tests(loader, tests, pattern):
return suite
if __name__=="__main__":
if len(sys.argv)>1:
# run a selection of tests
suite=unittest.TestSuite([test_suites[item+'_test'] for item in sys.argv[1:]])
unittest.TextTestRunner(verbosity=2).run(suite)