Coverage for gpkit\tests\run_tests.py: 0%
31 statements
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-05 22:34 -0500
« prev ^ index » next coverage.py v7.4.0, created at 2024-01-05 22:34 -0500
1"""Script for running all gpkit unit tests"""
2from gpkit.tests.helpers import run_tests
3#pylint: disable=import-outside-toplevel
6def import_tests():
7 """Get a list of all GPkit unit test TestCases"""
8 tests = []
10 from gpkit.tests import t_tools
11 tests += t_tools.TESTS
13 from gpkit.tests import t_sub
14 tests += t_sub.TESTS
16 from gpkit.tests import t_vars
17 tests += t_vars.TESTS
19 from gpkit.tests import t_nomials
20 tests += t_nomials.TESTS
22 from gpkit.tests import t_constraints
23 tests += t_constraints.TESTS
25 from gpkit.tests import t_nomial_array
26 tests += t_nomial_array.TESTS
28 from gpkit.tests import t_model
29 tests += t_model.TESTS
31 from gpkit.tests import t_solution_array
32 tests += t_solution_array.TESTS
34 from gpkit.tests import t_small
35 tests += t_small.TESTS
37 from gpkit.tests import t_examples
38 tests += t_examples.TESTS
40 from gpkit.tests import t_keydict
41 tests += t_keydict.TESTS
43 return tests
46def run(xmloutput=False, tests=None, verbosity=1):
47 """Run all gpkit unit tests.
49 Arguments
50 ---------
51 xmloutput: bool
52 If true, generate xml output files for continuous integration
53 """
54 if tests is None:
55 tests = import_tests()
56 if xmloutput:
57 run_tests(tests, xmloutput='test_reports')
58 else: # pragma: no cover
59 run_tests(tests, verbosity=verbosity)
61if __name__ == "__main__": # pragma: no cover
62 run()