]> gitweb.michael.orlitzky.com - dunshire.git/commitdiff
Enable and fix doctests for the new randomgen module.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 1 Nov 2016 17:20:05 +0000 (13:20 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 1 Nov 2016 17:20:05 +0000 (13:20 -0400)
test/__init__.py
test/randomgen.py

index bbcd4ab767f5cdfd4175b3b49a1edbd78f5e7cb7..1d7c9a907394483b2542fa3253b2d24c58e8a9b2 100644 (file)
@@ -14,6 +14,7 @@ from dunshire import cones
 from dunshire import errors
 from dunshire import matrices
 from dunshire import games
+from test import randomgen
 from test import symmetric_linear_game_test
 
 def build_suite():
@@ -23,9 +24,10 @@ def build_suite():
     suite = TestSuite()
     suite.addTest(DocTestSuite(cones))
     suite.addTest(DocTestSuite(errors))
-    suite.addTest(DocTestSuite(matrices))
     suite.addTest(DocTestSuite(games))
+    suite.addTest(DocTestSuite(matrices))
     suite.addTest(DocTestSuite(symmetric_linear_game_test))
+    suite.addTest(DocTestSuite(randomgen))
     slg_tests = TestLoader().loadTestsFromModule(symmetric_linear_game_test)
     suite.addTest(slg_tests)
     return suite
index ef1b19e569825625e134eeef84be3445f2f87b3c..6513440152d3e693618267d6b839faabaf8417f4 100644 (file)
@@ -200,9 +200,10 @@ def random_skew_symmetric_matrix(dims):
         >>> A.size
         (3, 3)
 
+        >>> from dunshire.options import ABS_TOL
         >>> from dunshire.matrices import norm
         >>> A = random_skew_symmetric_matrix(random_natural())
-        >>> norm(A + A.trans()) < options.ABS_TOL
+        >>> norm(A + A.trans()) < ABS_TOL
         True
 
     """
@@ -255,9 +256,12 @@ def random_lyapunov_like_icecream(dims):
         >>> L = random_lyapunov_like_icecream(3)
         >>> L.size
         (3, 3)
+
+        >>> from dunshire.options import ABS_TOL
+        >>> from dunshire.matrices import inner_product
         >>> x = matrix([1,1,0])
         >>> s = matrix([1,-1,0])
-        >>> abs(inner_product(L*x, s)) < options.ABS_TOL
+        >>> abs(inner_product(L*x, s)) < ABS_TOL
         True
 
     """