Skip to content

Commit

Permalink
TST: stats.kstest: add regression test for gh-20386
Browse files Browse the repository at this point in the history
  • Loading branch information
mdhaber committed Apr 14, 2024
1 parent 0be96de commit 5a5b27f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scipy/stats/tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -4231,6 +4231,14 @@ def test_agree_with_ks_1samp(self):
self._test_kstest_and_ks1samp(x, 'greater', mode='exact')
self._test_kstest_and_ks1samp(x, 'less', mode='exact')

def test_pm_inf_gh20386(self):
vals = [-np.inf, 0, 1, np.inf]
res = stats.kstest(vals, stats.cauchy.cdf)
ref = stats.kstest(vals, stats.cauchy.cdf, _no_deco=True)
assert_equal(res, ref)
assert not np.isnan(res.statistic)
assert not np.isnan(res.pvalue)

# missing: no test that uses *args


Expand Down

0 comments on commit 5a5b27f

Please sign in to comment.