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.
10 from unittest
import TestLoader
, TestSuite
, TextTestRunner
11 from doctest
import DocTestSuite
, ELLIPSIS
13 from dunshire
import cones
14 from dunshire
import errors
15 from dunshire
import matrices
16 from dunshire
import games
17 from test
import matrices_test
18 from test
import randomgen
19 from test
import symmetric_linear_game_test
21 def build_suite(doctests
=True):
23 Build our test suite, separately from running it.
29 Do you want to build the doctests, too? During random testing,
30 the answer may be "no."
35 suite
.addTest(DocTestSuite(cones
))
36 suite
.addTest(DocTestSuite(errors
, optionflags
=ELLIPSIS
))
37 suite
.addTest(DocTestSuite(games
, optionflags
=ELLIPSIS
))
38 suite
.addTest(DocTestSuite(matrices
, optionflags
=ELLIPSIS
))
39 suite
.addTest(DocTestSuite(symmetric_linear_game_test
))
40 suite
.addTest(DocTestSuite(randomgen
, optionflags
=ELLIPSIS
))
41 slg_tests
= TestLoader().loadTestsFromModule(symmetric_linear_game_test
)
42 suite
.addTest(slg_tests
)
43 mat_tests
= TestLoader().loadTestsFromModule(matrices_test
)
44 suite
.addTest(mat_tests
)
49 Run all of the unit and doctests for the ``dunshire`` and ``test``
52 runner
= TextTestRunner(verbosity
=1)
53 return runner
.run(suite
)