Skip to content

Commit

Permalink
Merge pull request #17272 from mdhaber/gh14901
Browse files Browse the repository at this point in the history
TST: stats: silence warnings temporarily
  • Loading branch information
tirthasheshpatel committed Oct 23, 2022
2 parents 942679e + e6e9ca8 commit 233555e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions scipy/stats/tests/test_boost_ufuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
]


@pytest.mark.filterwarnings('ignore::RuntimeWarning')
@pytest.mark.parametrize('func, args, expected', test_data)
def test_stats_boost_ufunc(func, args, expected):
type_sigs = func.types
Expand Down
2 changes: 2 additions & 0 deletions scipy/stats/tests/test_continuous_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def cases_test_cont_basic():
yield distname, arg


@pytest.mark.filterwarnings('ignore::RuntimeWarning')
@pytest.mark.parametrize('distname,arg', cases_test_cont_basic())
@pytest.mark.parametrize('sn, n_fit_samples', [(500, 200)])
def test_cont_basic(distname, arg, sn, n_fit_samples):
Expand Down Expand Up @@ -695,6 +696,7 @@ def check_fit_args_fix(distfn, arg, rvs, method):
npt.assert_(vals5[2] == arg[2])


@pytest.mark.filterwarnings('ignore::RuntimeWarning')
@pytest.mark.parametrize('method', ['pdf', 'logpdf', 'cdf', 'logcdf',
'sf', 'logsf', 'ppf', 'isf'])
@pytest.mark.parametrize('distname, args', distcont)
Expand Down
2 changes: 2 additions & 0 deletions scipy/stats/tests/test_discrete_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def cases_test_discrete_basic():
seen.add(distname)


@pytest.mark.filterwarnings('ignore::RuntimeWarning')
@pytest.mark.parametrize('distname,arg,first_case', cases_test_discrete_basic())
def test_discrete_basic(distname, arg, first_case):
try:
Expand Down Expand Up @@ -78,6 +79,7 @@ def test_discrete_basic(distname, arg, first_case):
check_private_entropy(distfn, arg, stats.rv_discrete)


@pytest.mark.filterwarnings('ignore::RuntimeWarning')
@pytest.mark.parametrize('distname,arg', distdiscrete)
def test_moments(distname, arg):
try:
Expand Down
1 change: 1 addition & 0 deletions scipy/stats/tests/test_discrete_distns.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def test_boost_divide_by_zero_issue_15101():
assert_allclose(binom.pmf(k, n, p), 0.0)


@pytest.mark.filterwarnings('ignore::RuntimeWarning')
def test_skellam_gh11474():
# test issue reported in gh-11474 caused by `cdfchn`
mu = [1, 10, 100, 1000, 5000, 5050, 5100, 5250, 6000]
Expand Down
5 changes: 5 additions & 0 deletions scipy/stats/tests/test_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3227,6 +3227,7 @@ def test_pmf(self):

assert_almost_equal(stats.skellam.pmf(k, mu1, mu2), skpmfR, decimal=15)

@pytest.mark.filterwarnings('ignore::RuntimeWarning')
def test_cdf(self):
# comparison to R, only 5 decimals
k = numpy.arange(-10, 15)
Expand Down Expand Up @@ -4826,6 +4827,7 @@ def test_logser(self):
res_l = stats.logser.expect(lambda k: k, args=(p,), loc=loc)
assert_allclose(res_l, res_0 + loc, atol=1e-15)

@pytest.mark.filterwarnings('ignore::RuntimeWarning')
def test_skellam(self):
# Use a discrete distribution w/ bi-infinite support. Compute two first
# moments and compare to known values (cf skellam.stats)
Expand Down Expand Up @@ -6298,6 +6300,7 @@ def test_distribution_too_many_args():
stats.ncf.pdf(x, 3, 4, 5, 6, 1.0) # 3 args, plus loc/scale


@pytest.mark.filterwarnings('ignore::RuntimeWarning')
def test_ncx2_tails_ticket_955():
# Trac #955 -- check that the cdf computed by special functions
# matches the integrated pdf
Expand Down Expand Up @@ -6351,12 +6354,14 @@ def test_ncx2_zero_nc_rvs():
assert_allclose(result, expected, atol=1e-15)


@pytest.mark.filterwarnings('ignore::RuntimeWarning')
def test_ncx2_gh12731():
# test that gh-12731 is resolved; previously these were all 0.5
nc = 10**np.arange(5, 10)
assert_equal(stats.ncx2.cdf(1e4, df=1, nc=nc), 0)


@pytest.mark.filterwarnings('ignore::RuntimeWarning')
def test_ncx2_gh8665():
# test that gh-8665 is resolved; previously this tended to nonzero value
x = np.array([4.99515382e+00, 1.07617327e+01, 2.31854502e+01,
Expand Down

0 comments on commit 233555e

Please sign in to comment.