Skip to content

Commit e586e2e

Browse files
committed
issue 30999 Disallow bare test
1 parent 13dc13f commit e586e2e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pandas/tests/arrays/boolean/test_arithmetic.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,22 @@ def test_error(self, data, all_arithmetic_operators):
2323
opa = getattr(data, op)
2424

2525
# invalid scalars
26-
with pytest.raises(TypeError):
26+
msg="invalid scalars"
27+
with pytest.raises(TypeError, match=msg):
2728
ops("foo")
28-
with pytest.raises(TypeError):
29+
with pytest.raises(TypeError, match=msg)
2930
ops(pd.Timestamp("20180101"))
3031

3132
# invalid array-likes
3233
if op not in ("__mul__", "__rmul__"):
3334
# TODO(extension) numpy's mul with object array sees booleans as numbers
34-
with pytest.raises(TypeError):
35+
msg="invalid array-likes,numpy's mul with object array sees booleans as numbers"
36+
with pytest.raises(TypeError, match=msg):
3537
ops(pd.Series("foo", index=s.index))
3638

3739
# 2d
3840
result = opa(pd.DataFrame({"A": s}))
3941
assert result is NotImplemented
40-
41-
with pytest.raises(NotImplementedError):
42+
msg="invalid array-likes"
43+
with pytest.raises(NotImplementedError, match=msg):
4244
opa(np.arange(len(s)).reshape(-1, len(s)))

0 commit comments

Comments
 (0)