]> gitweb.michael.orlitzky.com - dunshire.git/blob - test/__init__.py
Add two more TODOs, one minor, and one bad test failure.
[dunshire.git] / test / __init__.py
1 """
2 The whole test suite.
3
4 This module compiles the doctests and unittests from the rest of the
5 codebase into one big TestSuite() and the runs it. It also provides a
6 function :func:`build_suite` that merely builds the suite; the result
7 can be used by setuptools.
8 """
9
10 from unittest import TestLoader, TestSuite, TextTestRunner
11 from doctest import DocTestSuite
12
13 from dunshire import cones
14 from dunshire import errors
15 from dunshire import matrices
16 from dunshire import games
17 from test import symmetric_linear_game_test
18
19 def build_suite():
20 """
21 Build our test suite, separately from running it.
22 """
23 suite = TestSuite()
24 suite.addTest(DocTestSuite(cones))
25 suite.addTest(DocTestSuite(errors))
26 suite.addTest(DocTestSuite(matrices))
27 suite.addTest(DocTestSuite(games))
28 suite.addTest(DocTestSuite(symmetric_linear_game_test))
29 slg_tests = TestLoader().loadTestsFromModule(symmetric_linear_game_test)
30 suite.addTest(slg_tests)
31 return suite
32
33 def run_suite(suite):
34 """
35 Run all of the unit and doctests for the ``dunshire`` and ``test``
36 packages.
37 """
38 runner = TextTestRunner(verbosity=1)
39 return runner.run(suite)