MCPcopy Create free account
hub / github.com/apache/arrow / test_signed_integer_overflow

Function test_signed_integer_overflow

python/pyarrow/tests/test_convert_builtin.py:499–505  ·  view source on GitHub ↗
(bits)

Source from the content-addressed store, hash-verified

497
498@pytest.mark.parametrize("bits", [8, 16, 32, 64])
499def test_signed_integer_overflow(bits):
500 ty = getattr(pa, "int%d" % bits)()
501 # XXX ideally would always raise OverflowError
502 with pytest.raises((OverflowError, pa.ArrowInvalid)):
503 pa.array([2 ** (bits - 1)], ty)
504 with pytest.raises((OverflowError, pa.ArrowInvalid)):
505 pa.array([-2 ** (bits - 1) - 1], ty)
506
507
508@pytest.mark.parametrize("bits", [8, 16, 32, 64])

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected