Skip to content

Commit 0dc93cd

Browse files
authored
TST: add message check to pytest.raises (tests/arrays/test_boolean.py) (#32397)
1 parent 4018550 commit 0dc93cd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/tests/arrays/test_boolean.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,11 @@ def test_coerce_to_numpy_array():
248248
tm.assert_numpy_array_equal(result, expected)
249249
# with missing values will raise error
250250
arr = pd.array([True, False, None], dtype="boolean")
251-
with pytest.raises(ValueError):
251+
msg = (
252+
"cannot convert to 'bool'-dtype NumPy array with missing values. "
253+
"Specify an appropriate 'na_value' for this dtype."
254+
)
255+
with pytest.raises(ValueError, match=msg):
252256
np.array(arr, dtype="bool")
253257

254258

0 commit comments

Comments
 (0)