Skip to content

Commit 2ba6be7

Browse files
gdex1simonjayhawkins
authored andcommitted
TST: Disallow bare pytest.raises (#31045)
1 parent 2170f4e commit 2ba6be7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/tests/arithmetic/test_object.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ def test_objarr_radd_str_invalid(self, dtype, data, box_with_array):
137137
ser = Series(data, dtype=dtype)
138138

139139
ser = tm.box_expected(ser, box_with_array)
140-
with pytest.raises(TypeError):
140+
msg = (
141+
"can only concatenate str|"
142+
"did not contain a loop with signature matching types|"
143+
"unsupported operand type|"
144+
"must be str"
145+
)
146+
with pytest.raises(TypeError, match=msg):
141147
"foo_" + ser
142148

143149
@pytest.mark.parametrize("op", [operator.add, ops.radd, operator.sub, ops.rsub])

0 commit comments

Comments
 (0)