Skip to content

Commit 3152141

Browse files
charlesdong1991rhshadrach
authored andcommitted
TST: Separate expanding_apply and rolling_apply out of consistency (pandas-dev#33817)
1 parent b6a18e9 commit 3152141

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

pandas/tests/window/moments/test_moments_expanding.py

+8
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,14 @@ def test_expanding_consistency(self, min_periods):
368368
),
369369
)
370370

371+
@pytest.mark.parametrize("min_periods", [0, 1, 2, 3, 4])
372+
def test_expanding_apply_consistency(self, min_periods):
373+
with warnings.catch_warnings():
374+
warnings.filterwarnings(
375+
"ignore",
376+
message=".*(empty slice|0 for slice).*",
377+
category=RuntimeWarning,
378+
)
371379
# test consistency between expanding_xyz() and either (a)
372380
# expanding_apply of Series.xyz(), or (b) expanding_apply of
373381
# np.nanxyz()

pandas/tests/window/moments/test_moments_rolling.py

+11
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,17 @@ def test_rolling_consistency(self, window, min_periods, center):
10131013
),
10141014
)
10151015

1016+
@pytest.mark.parametrize(
1017+
"window,min_periods,center", list(_rolling_consistency_cases())
1018+
)
1019+
def test_rolling_apply_consistency(self, window, min_periods, center):
1020+
1021+
with warnings.catch_warnings():
1022+
warnings.filterwarnings(
1023+
"ignore",
1024+
message=".*(empty slice|0 for slice).*",
1025+
category=RuntimeWarning,
1026+
)
10161027
# test consistency between rolling_xyz() and either (a)
10171028
# rolling_apply of Series.xyz(), or (b) rolling_apply of
10181029
# np.nanxyz()

0 commit comments

Comments
 (0)