From ff57fe55842669d6b512cd0171f18b9e3f1e7634 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Thu, 21 Oct 2021 20:46:19 -0700 Subject: [PATCH] Move moments/test_moments_rolling_*.py tests to windows/test_rolling_*.py --- pandas/tests/window/conftest.py | 28 ++++++++++++++++++- pandas/tests/window/moments/conftest.py | 23 --------------- ...functions.py => test_rolling_functions.py} | 0 ...g_quantile.py => test_rolling_quantile.py} | 0 ...skew_kurt.py => test_rolling_skew_kurt.py} | 0 5 files changed, 27 insertions(+), 24 deletions(-) rename pandas/tests/window/{moments/test_moments_rolling_functions.py => test_rolling_functions.py} (100%) rename pandas/tests/window/{moments/test_moments_rolling_quantile.py => test_rolling_quantile.py} (100%) rename pandas/tests/window/{moments/test_moments_rolling_skew_kurt.py => test_rolling_skew_kurt.py} (100%) diff --git a/pandas/tests/window/conftest.py b/pandas/tests/window/conftest.py index fd8c11bbace6e..7b1aa93b5923a 100644 --- a/pandas/tests/window/conftest.py +++ b/pandas/tests/window/conftest.py @@ -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, ) @@ -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), + ) diff --git a/pandas/tests/window/moments/conftest.py b/pandas/tests/window/moments/conftest.py index 829df1f3bfe2f..e843caa48f6d7 100644 --- a/pandas/tests/window/moments/conftest.py +++ b/pandas/tests/window/moments/conftest.py @@ -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(): diff --git a/pandas/tests/window/moments/test_moments_rolling_functions.py b/pandas/tests/window/test_rolling_functions.py similarity index 100% rename from pandas/tests/window/moments/test_moments_rolling_functions.py rename to pandas/tests/window/test_rolling_functions.py diff --git a/pandas/tests/window/moments/test_moments_rolling_quantile.py b/pandas/tests/window/test_rolling_quantile.py similarity index 100% rename from pandas/tests/window/moments/test_moments_rolling_quantile.py rename to pandas/tests/window/test_rolling_quantile.py diff --git a/pandas/tests/window/moments/test_moments_rolling_skew_kurt.py b/pandas/tests/window/test_rolling_skew_kurt.py similarity index 100% rename from pandas/tests/window/moments/test_moments_rolling_skew_kurt.py rename to pandas/tests/window/test_rolling_skew_kurt.py