Skip to content

Create test/window directory and conftest file #3

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

Closed
wants to merge 3 commits into from
Closed
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
Empty file added pandas/tests/window/__init__.py
Empty file.
51 changes: 51 additions & 0 deletions pandas/tests/window/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from typing import Any

import pytest


@pytest.fixture(params=[True, False])
def raw(request) -> bool:
return request.param


@pytest.fixture(
params=[
"triang",
"blackman",
"hamming",
"bartlett",
"bohman",
"blackmanharris",
"nuttall",
"barthann",
]
)
def win_types(request) -> str:
return request.param


@pytest.fixture(params=["kaiser", "gaussian", "general_gaussian", "exponential"])
def win_types_special(request) -> str:
return request.param


@pytest.fixture(
params=["sum", "mean", "median", "max", "min", "var", "std", "kurt", "skew"]
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a 1-line comment on each of these

def arithmetic_win_operators(request) -> str:
return request.param


@pytest.fixture(params=['right', 'left', 'both', 'neither'])
def closed(request) -> str:
return request.param


@pytest.fixture(params=[True, False])
def center(request) -> bool:
return request.param


@pytest.fixture(params=[None, 1])
def min_periods(request) -> Any:
return request.param
33 changes: 0 additions & 33 deletions pandas/tests/test_window.py → pandas/tests/window/test_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,6 @@ def assert_equal(left, right):
tm.assert_frame_equal(left, right)


@pytest.fixture(params=[True, False])
def raw(request):
return request.param


@pytest.fixture(
params=[
"triang",
"blackman",
"hamming",
"bartlett",
"bohman",
"blackmanharris",
"nuttall",
"barthann",
]
)
def win_types(request):
return request.param


@pytest.fixture(params=["kaiser", "gaussian", "general_gaussian", "exponential"])
def win_types_special(request):
return request.param


@pytest.fixture(
params=["sum", "mean", "median", "max", "min", "var", "std", "kurt", "skew"]
)
def arithmetic_win_operators(request):
return request.param


class Base:

_nan_locs = np.arange(20, 40)
Expand Down