Skip to content

Commit

Permalink
TST: #31922 assert no segmentation fault with numpy.array.__contains__ (
Browse files Browse the repository at this point in the history
  • Loading branch information
ylin00 authored Sep 19, 2020
1 parent 2705dd6 commit c33c3c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pandas/tests/scalar/test_na_scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,11 @@ def test_pickle_roundtrip_containers(as_frame, values, dtype):
s = s.to_frame(name="A")
result = tm.round_trip_pickle(s)
tm.assert_equal(result, s)


@pytest.mark.parametrize("array", [np.array(["a"], dtype=object), ["a"]])
def test_array_contains_na(array):
# GH 31922
msg = "boolean value of NA is ambiguous"
with pytest.raises(TypeError, match=msg):
NA in array

0 comments on commit c33c3c0

Please sign in to comment.