Skip to content

Commit 41c96e1

Browse files
authored
Move moments/test_moments_rolling_*.py tests to windows/test_rolling_*.py (#44141)
1 parent c420419 commit 41c96e1

File tree

5 files changed

+27
-24
lines changed

5 files changed

+27
-24
lines changed

pandas/tests/window/conftest.py

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
from datetime import timedelta
1+
from datetime import (
2+
datetime,
3+
timedelta,
4+
)
25

6+
import numpy as np
37
import pytest
48

59
import pandas.util._test_decorators as td
610

711
from pandas import (
812
DataFrame,
13+
Series,
14+
bdate_range,
915
to_datetime,
1016
)
1117

@@ -235,3 +241,23 @@ def pairwise_other_frame():
235241
[[None, 1, 1], [None, 1, 2], [None, 3, 2], [None, 8, 1]],
236242
columns=["Y", "Z", "X"],
237243
)
244+
245+
246+
@pytest.fixture
247+
def series():
248+
"""Make mocked series as fixture."""
249+
arr = np.random.randn(100)
250+
locs = np.arange(20, 40)
251+
arr[locs] = np.NaN
252+
series = Series(arr, index=bdate_range(datetime(2009, 1, 1), periods=100))
253+
return series
254+
255+
256+
@pytest.fixture
257+
def frame():
258+
"""Make mocked frame as fixture."""
259+
return DataFrame(
260+
np.random.randn(100, 10),
261+
index=bdate_range(datetime(2009, 1, 1), periods=100),
262+
columns=np.arange(10),
263+
)

pandas/tests/window/moments/conftest.py

-23
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,13 @@
1-
from datetime import datetime
2-
31
import numpy as np
42
import pytest
53

64
from pandas import (
75
DataFrame,
86
Series,
9-
bdate_range,
107
notna,
118
)
129

1310

14-
@pytest.fixture
15-
def series():
16-
"""Make mocked series as fixture."""
17-
arr = np.random.randn(100)
18-
locs = np.arange(20, 40)
19-
arr[locs] = np.NaN
20-
series = Series(arr, index=bdate_range(datetime(2009, 1, 1), periods=100))
21-
return series
22-
23-
24-
@pytest.fixture
25-
def frame():
26-
"""Make mocked frame as fixture."""
27-
return DataFrame(
28-
np.random.randn(100, 10),
29-
index=bdate_range(datetime(2009, 1, 1), periods=100),
30-
columns=np.arange(10),
31-
)
32-
33-
3411
# create the data only once as we are not setting it
3512
def _create_consistency_data():
3613
def create_series():

0 commit comments

Comments
 (0)