Skip to content

Commit 4cf561f

Browse files
authored
TST: GH30999 add msg to pytest.raises in pandas/tests/window/moments (#38804)
1 parent a478fde commit 4cf561f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pandas/tests/window/moments/test_moments_ewm.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,12 @@ def test_ewma_halflife_arg(series):
218218
msg = "comass, span, halflife, and alpha are mutually exclusive"
219219
with pytest.raises(ValueError, match=msg):
220220
series.ewm(span=20, halflife=50)
221-
with pytest.raises(ValueError):
221+
with pytest.raises(ValueError, match=msg):
222222
series.ewm(com=9.5, halflife=50)
223-
with pytest.raises(ValueError):
223+
with pytest.raises(ValueError, match=msg):
224224
series.ewm(com=9.5, span=20, halflife=50)
225-
with pytest.raises(ValueError):
225+
msg = "Must pass one of comass, span, halflife, or alpha"
226+
with pytest.raises(ValueError, match=msg):
226227
series.ewm()
227228

228229

pandas/tests/window/test_apply.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def f(x):
4444
expected = df.iloc[2:].reindex_like(df)
4545
tm.assert_frame_equal(result, expected)
4646

47-
with pytest.raises(AttributeError):
47+
with tm.external_error_raised(AttributeError):
4848
df.rolling(window).apply(f, raw=True)
4949

5050

0 commit comments

Comments
 (0)