Skip to content

Move moments/test_moments_rolling_*.py tests to windows/test_rolling_*.py #44141

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 2 commits into from
Oct 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion pandas/tests/window/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
from datetime import timedelta
from datetime import (
datetime,
timedelta,
)

import numpy as np
import pytest

import pandas.util._test_decorators as td

from pandas import (
DataFrame,
Series,
bdate_range,
to_datetime,
)

Expand Down Expand Up @@ -235,3 +241,23 @@ def pairwise_other_frame():
[[None, 1, 1], [None, 1, 2], [None, 3, 2], [None, 8, 1]],
columns=["Y", "Z", "X"],
)


@pytest.fixture
def series():
"""Make mocked series as fixture."""
arr = np.random.randn(100)
locs = np.arange(20, 40)
arr[locs] = np.NaN
series = Series(arr, index=bdate_range(datetime(2009, 1, 1), periods=100))
return series


@pytest.fixture
def frame():
"""Make mocked frame as fixture."""
return DataFrame(
np.random.randn(100, 10),
index=bdate_range(datetime(2009, 1, 1), periods=100),
columns=np.arange(10),
)
23 changes: 0 additions & 23 deletions pandas/tests/window/moments/conftest.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,13 @@
from datetime import datetime

import numpy as np
import pytest

from pandas import (
DataFrame,
Series,
bdate_range,
notna,
)


@pytest.fixture
def series():
"""Make mocked series as fixture."""
arr = np.random.randn(100)
locs = np.arange(20, 40)
arr[locs] = np.NaN
series = Series(arr, index=bdate_range(datetime(2009, 1, 1), periods=100))
return series


@pytest.fixture
def frame():
"""Make mocked frame as fixture."""
return DataFrame(
np.random.randn(100, 10),
index=bdate_range(datetime(2009, 1, 1), periods=100),
columns=np.arange(10),
)


# create the data only once as we are not setting it
def _create_consistency_data():
def create_series():
Expand Down