Skip to content

Commit c33c3c0

Browse files
authored
TST: #31922 assert no segmentation fault with numpy.array.__contains__ (#36283)
1 parent 2705dd6 commit c33c3c0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/scalar/test_na_scalar.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,11 @@ def test_pickle_roundtrip_containers(as_frame, values, dtype):
305305
s = s.to_frame(name="A")
306306
result = tm.round_trip_pickle(s)
307307
tm.assert_equal(result, s)
308+
309+
310+
@pytest.mark.parametrize("array", [np.array(["a"], dtype=object), ["a"]])
311+
def test_array_contains_na(array):
312+
# GH 31922
313+
msg = "boolean value of NA is ambiguous"
314+
with pytest.raises(TypeError, match=msg):
315+
NA in array

0 commit comments

Comments
 (0)