diff options
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/tests/test_errstate.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/numpy/core/tests/test_errstate.py b/numpy/core/tests/test_errstate.py index 7c1780607..184a37300 100644 --- a/numpy/core/tests/test_errstate.py +++ b/numpy/core/tests/test_errstate.py @@ -1,12 +1,19 @@ -import platform import pytest +import sysconfig import numpy as np from numpy.testing import assert_, assert_raises +# The floating point emulation on ARM EABI systems lacking a hardware FPU is +# known to be buggy. This is an attempt to identify these hosts. It may not +# catch all possible cases, but it catches the known cases of gh-413 and +# gh-15562. +hosttype = sysconfig.get_config_var('HOST_GNU_TYPE') +arm_softfloat = False if hosttype is None else hosttype.endswith('gnueabi') class TestErrstate: - @pytest.mark.skipif(platform.machine() == "armv5tel", reason="See gh-413.") + @pytest.mark.skipif(arm_softfloat, + reason='platform/cpu issue with FPU (gh-413,-15562)') def test_invalid(self): with np.errstate(all='raise', under='ignore'): a = -np.arange(3) @@ -17,6 +24,8 @@ class TestErrstate: with assert_raises(FloatingPointError): np.sqrt(a) + @pytest.mark.skipif(arm_softfloat, + reason='platform/cpu issue with FPU (gh-15562)') def test_divide(self): with np.errstate(all='raise', under='ignore'): a = -np.arange(3) @@ -26,6 +35,9 @@ class TestErrstate: # While this should fail! with assert_raises(FloatingPointError): a // 0 + # As should this, see gh-15562 + with assert_raises(FloatingPointError): + a // a def test_errcall(self): def foo(*args): |