Skip to content

Commit b1bb9da

Browse files
committed
TST: pandas-dev#31922 assert no segmentation fault with numpy.array.__contains__
1 parent a09259b commit b1bb9da

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/tests/scalar/test_na_scalar.py

+14
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,17 @@ 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+
def test_np_array_contains_na():
311+
# GH 31922
312+
msg = "boolean value of NA is ambiguous"
313+
with pytest.raises(TypeError, match=msg):
314+
NA in np.array(["a"], dtype=object)
315+
316+
317+
def test_list_contains_na():
318+
# GH 31922
319+
msg = "boolean value of NA is ambiguous"
320+
with pytest.raises(TypeError, match=msg):
321+
NA in ["a"]

0 commit comments

Comments
 (0)