Skip to content

Commit 3170f9c

Browse files
ylin00Kevin D Smith
authored and
Kevin D Smith
committed
TST: pandas-dev#31922 assert no segmentation fault with numpy.array.__contains__ (pandas-dev#36283)
1 parent 98e62c5 commit 3170f9c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/scalar/test_na_scalar.py

+8
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)