[Scipy-svn] r6997 - trunk/scipy/stats/tests

scipy-svn@scip... scipy-svn@scip...
Sun Dec 5 00:39:11 CST 2010


Author: rgommers
Date: 2010-12-05 00:39:11 -0600 (Sun, 05 Dec 2010)
New Revision: 6997

Modified:
   trunk/scipy/stats/tests/test_stats.py
Log:
TST: add correct significance to some stats tests. Closes #467.

Modified: trunk/scipy/stats/tests/test_stats.py
===================================================================
--- trunk/scipy/stats/tests/test_stats.py	2010-12-05 05:54:13 UTC (rev 6996)
+++ trunk/scipy/stats/tests/test_stats.py	2010-12-05 06:39:11 UTC (rev 6997)
@@ -114,26 +114,23 @@
         II. C. Basic Statistics
     """
 
+    dprec = np.finfo(np.float64).precision
+
+    # Really need to write these tests to handle missing values properly
     def test_tmeanX(self):
         y = stats.tmean(X, (2, 8), (True, True))
-        assert_almost_equal(y, 5.0)
+        assert_approx_equal(y, 5.0, significant=TestBasicStats.dprec)
 
     def test_tvarX(self):
         y = stats.tvar(X, (2, 8), (True, True))
-        assert_almost_equal(y, 4.6666666666666661)
+        assert_approx_equal(y, 4.6666666666666661,
+                            significant=TestBasicStats.dprec)
 
     def test_tstdX(self):
         y = stats.tstd(X, (2, 8), (True, True))
-        assert_almost_equal(y, 2.1602468994692865)
+        assert_approx_equal(y, 2.1602468994692865,
+                            significant=TestBasicStats.dprec)
 
-##    Really need to write these tests to handle missing values properly
-##    def test_meanMISS(self):
-##        y = np.mean(MISS)
-##        assert_almost_equal(y, 0.0)
-##
-##    def test_stdMISS(self):
-##        y = stats.stdev(MISS)
-##        assert_almost_equal(y, 0.0)
 
 
 class TestNanFunc(TestCase):



More information about the Scipy-svn mailing list