Skip to content

Commit e502de2

Browse files
committed
TST: Ignore floating point warning tests on MacOS
It is very much possible that this will also fail on other systems and should rather only run, e.g. on newer glibc versions. In principle, we could also split this into "no warnings given" and "warning given". MacOS seems very sloppy with floating point warnings, but hopefully it at least does not give spurious ones.
1 parent e67c9c9 commit e502de2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

numpy/core/tests/test_umath.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,9 @@ def test_float_remainder_roundoff(self):
563563
else:
564564
assert_(b > rem >= 0, msg)
565565

566+
@pytest.mark.xfail(sys.platform.startswith("darwin"),
567+
reason="MacOS seems to not give the correct 'invalid' warning for "
568+
"`fmod`. Hopefully, others always do.")
566569
@pytest.mark.parametrize('dtype', np.typecodes['Float'])
567570
def test_float_divmod_errors(self, dtype):
568571
# Check valid errors raised for divmod and remainder
@@ -586,6 +589,9 @@ def test_float_divmod_errors(self, dtype):
586589
# inf / 0 does not set any flags, only the modulo creates a NaN
587590
np.divmod(finf, fzero)
588591

592+
@pytest.mark.xfail(sys.platform.startswith("darwin"),
593+
reason="MacOS seems to not give the correct 'invalid' warning for "
594+
"`fmod`. Hopefully, others always do.")
589595
@pytest.mark.parametrize('dtype', np.typecodes['Float'])
590596
@pytest.mark.parametrize('fn', [np.fmod, np.remainder])
591597
def test_float_remainder_errors(self, dtype, fn):

0 commit comments

Comments
 (0)