]> gitweb.michael.orlitzky.com - dunshire.git/commitdiff
Load unit tests from symmetric_linear_game in the test suite.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 10 Oct 2016 02:03:44 +0000 (22:03 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 10 Oct 2016 02:36:20 +0000 (22:36 -0400)
test/suite.py

index 22579ca9a3a1ea71abf3764a38a3c4979f05e4bb..bfd0011ff3b1a40d9e1e82b238766e65e179a8d9 100644 (file)
@@ -1,5 +1,12 @@
-import unittest
-import doctest
+"""
+The whole test suite.
+
+This module compiles the doctests and unittests from the rest of the
+codebase into one big TestSuite() and the runs it.
+"""
+
+from unittest import TestLoader, TestSuite, TextTestRunner
+from doctest import DocTestSuite
 
 # Add '../' to our path.
 from site import addsitedir
@@ -9,11 +16,11 @@ import errors
 import matrices
 import symmetric_linear_game
 
-suite = unittest.TestSuite()
-suite.addTest(doctest.DocTestSuite(cones))
-suite.addTest(doctest.DocTestSuite(errors))
-suite.addTest(doctest.DocTestSuite(matrices))
-suite.addTest(doctest.DocTestSuite(symmetric_linear_game))
-
-runner = unittest.TextTestRunner(verbosity=2)
+suite = TestSuite()
+suite.addTest(DocTestSuite(cones))
+suite.addTest(DocTestSuite(errors))
+suite.addTest(DocTestSuite(matrices))
+suite.addTest(DocTestSuite(symmetric_linear_game))
+suite.addTest(TestLoader().loadTestsFromModule(symmetric_linear_game))
+runner = TextTestRunner(verbosity=2)
 runner.run(suite)