Permalink
Browse files

TST: filter warning message from stats test.

Introduced by recent change in warning mechanism in special module.
Leaving the test unchanged, because it's a regression test.
Fitting with n=1 fixed would be better, but doesn't seem to be supported yet.
  • Loading branch information...
rgommers committed Dec 17, 2012
1 parent ef85190 commit 78da5a6237db11c86710207dc875e2067987db83
Showing with 6 additions and 7 deletions.
  1. +4 −4 scipy/stats/distributions.py
  2. +2 −3 scipy/stats/tests/test_distributions.py
@@ -1965,10 +1965,10 @@ class ksone_gen(rv_continuous):
%(default)s
"""
- def _cdf(self,x,n):
- return 1.0-special.smirnov(n,x)
- def _ppf(self,q,n):
- return special.smirnovi(n,1.0-q)
+ def _cdf(self, x, n):
+ return 1.0 - special.smirnov(n, x)
+ def _ppf(self, q, n):
+ return special.smirnovi(n, 1.0 - q)
ksone = ksone_gen(a=0.0, name='ksone', shapes="n")
class kstwobign_gen(rv_continuous):
@@ -891,9 +891,7 @@ def test_powerlaw_stats():
def test_ksone_fit_freeze():
- """Regression test for ticket #1638.
-
- """
+ #Regression test for ticket #1638.
d = np.array(
[-0.18879233, 0.15734249, 0.18695107, 0.27908787, -0.248649,
-0.2171497 , 0.12233512, 0.15126419, 0.03119282, 0.4365294 ,
@@ -911,6 +909,7 @@ def test_ksone_fit_freeze():
warn_ctx.__enter__()
try:
warnings.simplefilter('ignore', UserWarning)
+ warnings.simplefilter('ignore', RuntimeWarning)
stats.ksone.fit(d)
finally:
warn_ctx.__exit__()

0 comments on commit 78da5a6

Please sign in to comment.