8000 test_float_remainder_overflow fails on intel 32-bit because divmod(_, tiny) does not raise invalid value · Issue #18388 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
test_float_remainder_overflow fails on intel 32-bit because divmod(_, tiny) does not raise invalid value #18388
Open
@bnavigator

Description

@bnavigator

While building and testing NumPy 1.20.0 for openSUSE Tumbleweed on i586 architecture:

[ 1044s] _________________ TestRemainder.test_float_remainder_overflow __________________
[ 1044s] [gw7] linux -- Python 3.8.7 /usr/bin/python3.8
[ 1044s] 
[ 1044s] self = <numpy.core.tests.test_umath.TestRemainder object at 0xf075f448>
[ 1044s] 
[ 1044s]     def test_float_remainder_overflow(self):
[ 1044s]         a = np.finfo(np.float64).tiny
[ 1044s]         with np.errstate(over='ignore', invalid='ignore'):
[ 1044s]             div, mod = np.divmod(4, a)
[ 1044s]             np.isinf(div)
[ 1044s]             assert_(mod == 0)
[ 1044s]         with np.errstate(over='raise', invalid='ignore'):
[ 1044s]             assert_raises(FloatingPointError, np.divmod, 4, a)
[ 1044s]         with np.errstate(invalid='raise', over='ignore'):
[ 1044s] >           assert_raises(FloatingPointError, np.divmod, 4, a)
[ 1044s] 
[ 1044s] ../../../BUILDROOT/python-numpy-1.20.0-90.1.i386/usr/lib/python3.8/site-packages/numpy/core/tests/test_umath.py:449: 
[ 1044s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[ 1044s] /usr/lib/python3.8/unittest/case.py:816: in assertRaises
[ 1044s]     return context.handle('assertRaises', args, kwargs)
[ 1044s] /usr/lib/python3.8/unittest/case.py:202: in handle
[ 1044s]     callable_obj(*args, **kwargs)
[ 1044s] /usr/lib/python3.8/unittest/case.py:224: in __exit__
[ 1044s]     self._raiseFailure("{} not raised by {}".format(exc_name,
[ 1044s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[ 1044s] 
[ 1044s] self = <unittest.case._AssertRaisesContext object at 0xf075f778>
[ 1044s] standardMsg = 'FloatingPointError not raised by divmod'
[ 1044s] 
[ 1044s]     def _raiseFailure(self, standardMsg):
[ 1044s]         msg = self.test_case._formatMessage(self.msg, standardMsg)
[ 1044s] >       raise self.test_case.failureException(msg)
[ 1044s] E       AssertionError: FloatingPointError not raised by divmod
[ 1044s] 
[ 1044s] /usr/lib/python3.8/unittest/case.py:164: AssertionError
(Pdb) p a
2.2250738585072014e-308
(Pdb) np.divmod(4,a)
*** RuntimeWarning: overflow encountered in divmod
(Pdb) with np.errstate(over='raise', invalid='ignore'): np.divmod(4,a)
*** FloatingPointError: overflow encountered in divmod
(Pdb) with np.errstate(over='ignore', invalid='raise'): np.divmod(4,a)
(inf, 0.0)
(Pdb) p np.__version__
'1.20.0'
(Pdb) sys.version
'3.8.7 (default, Dec 22 2020, 08:33:13) [GCC]'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0