Skip to content

Commit e009d61

Browse files
committed
TST: assert no segmentation fault with numpy.array.__contains__ (pandas-dev#31922)
1 parent 263b0f9 commit e009d61

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

pandas/tests/scalar/test_na_scalar.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,9 @@ def test_pickle_roundtrip_containers(as_frame, values, dtype):
307307
tm.assert_equal(result, s)
308308

309309

310-
def test_np_array_contains_na():
310+
@pytest.mark.parametrize("array", [np.array(["a"], dtype=object), ["a"]])
311+
def test_array_contains_na(array):
311312
# GH 31922
312313
msg = "boolean value of NA is ambiguous"
313314
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"]
315+
NA in array

0 commit comments

Comments
 (0)