Skip to content

Commit 82f5395

Browse files
authored
TST: Move a consistency ewm test to test_ewm.py (#44171)
1 parent 9018d32 commit 82f5395

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

pandas/tests/window/moments/test_moments_consistency_ewm.py

-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@
99
import pandas._testing as tm
1010

1111

12-
@pytest.mark.parametrize("func", ["cov", "corr"])
13-
def test_ewm_pairwise_cov_corr(func, frame):
14-
result = getattr(frame.ewm(span=10, min_periods=5), func)()
15-
result = result.loc[(slice(None), 1), 5]
16-
result.index = result.index.droplevel(1)
17-
expected = getattr(frame[1].ewm(span=10, min_periods=5), func)(frame[5])
18-
tm.assert_series_equal(result, expected, check_names=False)
19-
20-
2112
def create_mock_weights(obj, com, adjust, ignore_na):
2213
if isinstance(obj, DataFrame):
2314
if not len(obj.columns):

pandas/tests/window/test_ewm.py

+9
Original file line numberDiff line numberDiff line change
@@ -657,3 +657,12 @@ def test_ewm_alpha_arg(series):
657657
s.ewm(span=10.0, alpha=0.5)
658658
with pytest.raises(ValueError, match=msg):
659659
s.ewm(halflife=10.0, alpha=0.5)
660+
661+
662+
@pytest.mark.parametrize("func", ["cov", "corr"])
663+
def test_ewm_pairwise_cov_corr(func, frame):
664+
result = getattr(frame.ewm(span=10, min_periods=5), func)()
665+
result = result.loc[(slice(None), 1), 5]
666+
result.index = result.index.droplevel(1)
667+
expected = getattr(frame[1].ewm(span=10, min_periods=5), func)(frame[5])
668+
tm.assert_series_equal(result, expected, check_names=False)

0 commit comments

Comments
 (0)