Skip to content

Commit

Permalink
TST: silence test failures on macOS for beta.ppf overflow (scipy#14938
Browse files Browse the repository at this point in the history
)

* TST: silence test failures on macOS for `beta.ppf` overflow

See scipygh-14901 for details.

[skip azp]
[skip github]

Co-authored-by: Tyler Reddy <tyler.je.reddy@gmail.com>
  • Loading branch information
rgommers and tylerjereddy committed Nov 5, 2021
1 parent 5f587c6 commit d450304
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scipy/stats/tests/test_distributions.py
Expand Up @@ -7,6 +7,7 @@
import pickle
import os
import json
import platform

from numpy.testing import (assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal,
Expand Down Expand Up @@ -37,6 +38,10 @@
# python -OO strips docstrings
DOCSTRINGS_STRIPPED = sys.flags.optimize > 1

# Failing on macOS 11, Intel CPUs. See gh-14901
MACOS_INTEL = (sys.platform == 'darwin') and (platform.machine() == 'x86_64')


# distributions to skip while testing the fix for the support method
# introduced in gh-13294. These distributions are skipped as they
# always return a non-nan support for every parametrization.
Expand Down Expand Up @@ -2840,6 +2845,7 @@ def test_fit_duplicated_fixed_parameter(self):
x = [0.1, 0.5, 0.6]
assert_raises(ValueError, stats.beta.fit, x, fa=0.5, fix_a=0.5)

@pytest.mark.skipif(MACOS_INTEL, reason="Overflow, see gh-14901")
def test_issue_12635(self):
# Confirm that Boost's beta distribution resolves gh-12635.
# Check against R:
Expand All @@ -2851,6 +2857,7 @@ def test_issue_12635(self):
p, a, b = 0.9999999999997369, 75.0, 66334470.0
assert_allclose(stats.beta.ppf(p, a, b), 2.343620802982393e-06)

@pytest.mark.skipif(MACOS_INTEL, reason="Overflow, see gh-14901")
def test_issue_12794(self):
# Confirm that Boost's beta distribution resolves gh-12794.
# Check against R.
Expand All @@ -2868,6 +2875,7 @@ def test_issue_12794(self):
res = stats.beta.sf(inv, count_list + 1, 100000 - count_list)
assert_allclose(res, p)

@pytest.mark.skipif(MACOS_INTEL, reason="Overflow, see gh-14901")
def test_issue_12796(self):
# Confirm that Boost's beta distribution succeeds in the case
# of gh-12796
Expand Down

0 comments on commit d450304

Please sign in to comment.