[Scipy-svn] r2548 - trunk/Lib/sandbox/models/tests

scipy-svn at scipy.org scipy-svn at scipy.org
Sun Jan 14 07:52:34 CST 2007


Author: jarrod.millman
Date: 2007-01-14 07:52:31 -0600 (Sun, 14 Jan 2007)
New Revision: 2548

Modified:
   trunk/Lib/sandbox/models/tests/test_formula.py
   trunk/Lib/sandbox/models/tests/test_glm.py
   trunk/Lib/sandbox/models/tests/test_regression.py
   trunk/Lib/sandbox/models/tests/test_robust.py
   trunk/Lib/sandbox/models/tests/test_utils.py
Log:
cleaning up tests


Modified: trunk/Lib/sandbox/models/tests/test_formula.py
===================================================================
--- trunk/Lib/sandbox/models/tests/test_formula.py	2007-01-14 13:12:30 UTC (rev 2547)
+++ trunk/Lib/sandbox/models/tests/test_formula.py	2007-01-14 13:52:31 UTC (rev 2548)
@@ -1,17 +1,17 @@
 import csv
 import os
 import string
-import unittest
+#import unittest
 
 import numpy as N
 import numpy.random as R
 import numpy.linalg as L
-from numpy.testing import assert_almost_equal, NumpyTestCase
+from numpy.testing import assert_almost_equal, NumpyTest, NumpyTestCase
 import scipy
 
 from scipy.sandbox.models import utils, formula, contrast
 
-class test_term(unittest.TestCase):
+class test_term(NumpyTestCase):
 
     def test_init(self):
         t1 = formula.term("trivial")
@@ -226,10 +226,11 @@
         
         self.assertEquals(estimable, False)
 
-def suite():
-    suite = unittest.makeSuite(formulaTest)
-    return suite
+#def suite():
+#    suite = unittest.makeSuite(formulaTest)
+#    return suite
 
-
-if __name__ == '__main__':
-    unittest.main()
+if __name__ == "__main__":
+    NumpyTest().run()
+#if __name__ == '__main__':
+#    unittest.main()

Modified: trunk/Lib/sandbox/models/tests/test_glm.py
===================================================================
--- trunk/Lib/sandbox/models/tests/test_glm.py	2007-01-14 13:12:30 UTC (rev 2547)
+++ trunk/Lib/sandbox/models/tests/test_glm.py	2007-01-14 13:52:31 UTC (rev 2548)
@@ -1,4 +1,4 @@
-import unittest
+#import unittest
 
 import numpy as N
 import numpy.random as R

Modified: trunk/Lib/sandbox/models/tests/test_regression.py
===================================================================
--- trunk/Lib/sandbox/models/tests/test_regression.py	2007-01-14 13:12:30 UTC (rev 2547)
+++ trunk/Lib/sandbox/models/tests/test_regression.py	2007-01-14 13:52:31 UTC (rev 2548)
@@ -1,12 +1,13 @@
-import unittest
+#import unittest
 
 from numpy.random import standard_normal
+from numpy.testing import NumpyTest, NumpyTestCase
 
 from scipy.sandbox.models.regression import ols_model, ar_model
 
 W = standard_normal
 
-class test_Regression(unittest.TestCase):
+class test_Regression(NumpyTestCase):
 
     def testOLS(self):
         X = W((40,10))
@@ -38,6 +39,7 @@
         results = model.fit(Y)
         self.assertEquals(results.df_resid, 31)
 
-
-if __name__ == '__main__':
-    unittest.main()
+if __name__ == "__main__":
+    NumpyTest().run()
+#if __name__ == '__main__':
+#    unittest.main()

Modified: trunk/Lib/sandbox/models/tests/test_robust.py
===================================================================
--- trunk/Lib/sandbox/models/tests/test_robust.py	2007-01-14 13:12:30 UTC (rev 2547)
+++ trunk/Lib/sandbox/models/tests/test_robust.py	2007-01-14 13:52:31 UTC (rev 2548)
@@ -1,12 +1,13 @@
-import unittest
+#import unittest
 
 import numpy.random as R
+from numpy.testing import NumpyTest, NumpyTestCase
 
 import scipy.sandbox.models as S
 
 W = R.standard_normal
 
-class RegressionTest(unittest.TestCase):
+class RegressionTest(NumpyTestCase):
 
     def testRobust(self):
         X = W((40,10))
@@ -23,6 +24,7 @@
         results = model.fit(Y)
         self.assertEquals(results.df_resid, 31)
 
-
-if __name__ == '__main__':
-    unittest.main()
+if __name__ == "__main__":
+    NumpyTest().run()
+#if __name__ == '__main__':
+#    unittest.main()

Modified: trunk/Lib/sandbox/models/tests/test_utils.py
===================================================================
--- trunk/Lib/sandbox/models/tests/test_utils.py	2007-01-14 13:12:30 UTC (rev 2547)
+++ trunk/Lib/sandbox/models/tests/test_utils.py	2007-01-14 13:52:31 UTC (rev 2548)
@@ -1,13 +1,13 @@
-import unittest
+#import unittest
 
 import numpy as N
 import numpy.random as R
-from numpy.testing import assert_almost_equal
+from numpy.testing import assert_almost_equal, NumpyTest, NumpyTestCase
 import scipy
 
 from scipy.sandbox.models import utils
 
-class test_Utils(unittest.TestCase):
+class test_Utils(NumpyTestCase):
 
     def test_recipr(self):
         X = N.array([[2,1],[-1,0]])
@@ -53,5 +53,7 @@
         y = N.zeros((2, 2))
         self.assertRaises(ValueError, utils.StepFunction, x, y)
 
-if __name__ == '__main__':
-    unittest.main()
+if __name__ == "__main__":
+    NumpyTest().run()
+#if __name__ == '__main__':
+#    unittest.main()



More information about the Scipy-svn mailing list