Skip to content

TST/REF: Move static methods out of consistency classes #33927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 2, 2020
30 changes: 16 additions & 14 deletions pandas/tests/window/moments/test_moments_ewm.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,24 +281,26 @@ def setup_method(self, method):
def test_ewmcov_pairwise(self):
self._check_pairwise_moment("ewm", "cov", span=10, min_periods=5)

@pytest.mark.parametrize("name", ["cov", "corr"])
def test_ewm_corr_cov(self, name, min_periods, binary_ew_data):
A, B = binary_ew_data

check_binary_ew(name="corr", A=A, B=B)
check_binary_ew_min_periods("corr", min_periods, A, B)

def test_ewmcorr_pairwise(self):
self._check_pairwise_moment("ewm", "corr", span=10, min_periods=5)

@pytest.mark.parametrize("name", ["cov", "corr"])
def test_different_input_array_raise_exception(self, name, binary_ew_data):

A, _ = binary_ew_data
msg = "Input arrays must be of the same type!"
# exception raised is Exception
with pytest.raises(Exception, match=msg):
ew_func(A, randn(50), 20, name=name, min_periods=5)
@pytest.mark.parametrize("name", ["cov", "corr"])
def test_ewm_corr_cov(name, min_periods, binary_ew_data):
A, B = binary_ew_data

check_binary_ew(name="corr", A=A, B=B)
check_binary_ew_min_periods("corr", min_periods, A, B)


@pytest.mark.parametrize("name", ["cov", "corr"])
def test_different_input_array_raise_exception(name, binary_ew_data):

A, _ = binary_ew_data
msg = "Input arrays must be of the same type!"
# exception raised is Exception
with pytest.raises(Exception, match=msg):
ew_func(A, randn(50), 20, name=name, min_periods=5)


@pytest.mark.slow
Expand Down
Loading