Skip to content

Commit 7b99f03

Browse files
authored
TST: Fixed bare pytest.raises in test_window.py (#32158)
1 parent 7017599 commit 7b99f03

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pandas/tests/window/test_window.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ def test_constructor(self, which):
2929
c(win_type="boxcar", window=2, min_periods=1, center=False)
3030

3131
# not valid
32+
msg = "|".join(["min_periods must be an integer", "center must be a boolean"])
3233
for w in [2.0, "foo", np.array([2])]:
33-
with pytest.raises(ValueError):
34+
with pytest.raises(ValueError, match=msg):
3435
c(win_type="boxcar", window=2, min_periods=w)
35-
with pytest.raises(ValueError):
36+
with pytest.raises(ValueError, match=msg):
3637
c(win_type="boxcar", window=2, min_periods=1, center=w)
3738

3839
for wt in ["foobar", 1]:
39-
with pytest.raises(ValueError):
40+
with pytest.raises(ValueError, match="Invalid win_type"):
4041
c(win_type=wt, window=2)
4142

4243
@td.skip_if_no_scipy

0 commit comments

Comments
 (0)