Skip to content

Commit

Permalink
TST: GH30999 add msg to pytest.raises in pandas/tests/window/moments (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
moink authored and luckyvs1 committed Jan 20, 2021
1 parent 7bb51e7 commit 6b456f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pandas/tests/window/moments/test_moments_ewm.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,12 @@ def test_ewma_halflife_arg(series):
msg = "comass, span, halflife, and alpha are mutually exclusive"
with pytest.raises(ValueError, match=msg):
series.ewm(span=20, halflife=50)
with pytest.raises(ValueError):
with pytest.raises(ValueError, match=msg):
series.ewm(com=9.5, halflife=50)
with pytest.raises(ValueError):
with pytest.raises(ValueError, match=msg):
series.ewm(com=9.5, span=20, halflife=50)
with pytest.raises(ValueError):
msg = "Must pass one of comass, span, halflife, or alpha"
with pytest.raises(ValueError, match=msg):
series.ewm()


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/window/test_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def f(x):
expected = df.iloc[2:].reindex_like(df)
tm.assert_frame_equal(result, expected)

with pytest.raises(AttributeError):
with tm.external_error_raised(AttributeError):
df.rolling(window).apply(f, raw=True)


Expand Down

0 comments on commit 6b456f6

Please sign in to comment.