Skip to content

Commit ce83026

Browse files
authored
TST IntegerArray bounds error closing GH21796 (#42267)
1 parent 0135b79 commit ce83026

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/arrays/test_array.py

+8
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,14 @@ def test_scalar_raises():
309309
pd.array(1)
310310

311311

312+
def test_bounds_check():
313+
# GH21796
314+
with pytest.raises(
315+
TypeError, match=r"cannot safely cast non-equivalent int(32|64) to uint16"
316+
):
317+
pd.array([-1, 2, 3], dtype="UInt16")
318+
319+
312320
# ---------------------------------------------------------------------------
313321
# A couple dummy classes to ensure that Series and Indexes are unboxed before
314322
# getting to the EA classes.

0 commit comments

Comments
 (0)