[Scipy-svn] r5091 - trunk/scipy/stats/tests
scipy-svn at scipy.org
scipy-svn at scipy.org
Thu Nov 13 14:40:03 EST 2008
Author: josef
Date: 2008-11-13 13:40:00 -0600 (Thu, 13 Nov 2008)
New Revision: 5091
Modified:
trunk/scipy/stats/tests/test_discrete_chisquare.py
Log:
add random seed to test, drop known failing test (logser) temporarily
Modified: trunk/scipy/stats/tests/test_discrete_chisquare.py
===================================================================
--- trunk/scipy/stats/tests/test_discrete_chisquare.py 2008-11-13 05:58:16 UTC (rev 5090)
+++ trunk/scipy/stats/tests/test_discrete_chisquare.py 2008-11-13 19:40:00 UTC (rev 5091)
@@ -1,6 +1,7 @@
import numpy as np
from scipy import stats
+from numpy.testing import dec
debug = False
@@ -31,6 +32,7 @@
wsupp = 1.0/nsupp
distfn = getattr(stats, distname)
+ np.random.seed(9765456)
rvs = distfn.rvs(size=n,*arg)
# construct intervals with minimum mass 1/nsupp
@@ -74,9 +76,8 @@
print 'n*pmf', n*distfn.pmf(list(distsupport)[:10],*arg)
assert (pval > alpha), 'chisquare - test for %s' \
- 'at arg = %s' % (distname,str(arg))
+ 'at arg = %s with pval = %s' % (distname,str(arg),str(pval))
-
def test_discrete_rvs_cdf():
distdiscrete = [
['bernoulli',(0.3,)],
@@ -91,12 +92,32 @@
['poisson', (0.6,)],
['randint', (7, 31)],
['zipf', (2,)] ]
+
+ distknownfail = ['logser']
- for distname, arg in distdiscrete:
+ for distname, arg in distdiscrete: #[['nbinom', (5, 0.5)]]: #distdiscrete:
+ if distname in distknownfail:
+ continue
if debug:
print distname
yield check_discrete_chisquare, distname, arg
+
+# decorator does not seem to work correctly with yield ????
+# I get error instead of yield
+# drop failing test for now
+ at dec.knownfailureif(True, "This test is known to fail")
+def _est_discrete_rvs_cdf_fail():
+ distknownfail = [ ['logser', (0.6,)]]
+ for distname, arg in distknownfail:
+ if debug:
+ print distname
+ yield check_discrete_chisquare, distname, arg
+
+
+
+
+
if __name__ == '__main__':
import nose
nose.run(argv=['', __file__])
More information about the Scipy-svn
mailing list