Skip to content

Commit c7b773a

Browse files
charlesdong1991rhshadrach
authored andcommitted
TST/REF: Move static methods out of consistency classes (pandas-dev#33927)
1 parent f500f5c commit c7b773a

File tree

3 files changed

+605
-600
lines changed

3 files changed

+605
-600
lines changed

pandas/tests/window/moments/test_moments_ewm.py

+16-14
Original file line numberDiff line numberDiff line change
@@ -281,24 +281,26 @@ def setup_method(self, method):
281281
def test_ewmcov_pairwise(self):
282282
self._check_pairwise_moment("ewm", "cov", span=10, min_periods=5)
283283

284-
@pytest.mark.parametrize("name", ["cov", "corr"])
285-
def test_ewm_corr_cov(self, name, min_periods, binary_ew_data):
286-
A, B = binary_ew_data
287-
288-
check_binary_ew(name="corr", A=A, B=B)
289-
check_binary_ew_min_periods("corr", min_periods, A, B)
290-
291284
def test_ewmcorr_pairwise(self):
292285
self._check_pairwise_moment("ewm", "corr", span=10, min_periods=5)
293286

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

297-
A, _ = binary_ew_data
298-
msg = "Input arrays must be of the same type!"
299-
# exception raised is Exception
300-
with pytest.raises(Exception, match=msg):
301-
ew_func(A, randn(50), 20, name=name, min_periods=5)
288+
@pytest.mark.parametrize("name", ["cov", "corr"])
289+
def test_ewm_corr_cov(name, min_periods, binary_ew_data):
290+
A, B = binary_ew_data
291+
292+
check_binary_ew(name="corr", A=A, B=B)
293+
check_binary_ew_min_periods("corr", min_periods, A, B)
294+
295+
296+
@pytest.mark.parametrize("name", ["cov", "corr"])
297+
def test_different_input_array_raise_exception(name, binary_ew_data):
298+
299+
A, _ = binary_ew_data
300+
msg = "Input arrays must be of the same type!"
301+
# exception raised is Exception
302+
with pytest.raises(Exception, match=msg):
303+
ew_func(A, randn(50), 20, name=name, min_periods=5)
302304

303305

304306
@pytest.mark.slow

0 commit comments

Comments
 (0)