10000 BUG: Fix warning problems of the mod operator by arubiales · Pull Request #19316 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: Fix warning problems of the mod operator #19316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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.
  • Loading branch information
seberg committed Jul 12, 2021
commit e502de26b8c84802e224e0bad66f9d179b51eab9
6 changes: 6 additions & 0 deletions numpy/core/tests/test_umath.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,9 @@ def test_float_remainder_roundoff(self):
else:
assert_(b > rem >= 0, msg)

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

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