Skip to content

TST: use index_or_series fixture #29996

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
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
10 changes: 6 additions & 4 deletions pandas/tests/arithmetic/test_datetime64.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ class TestDatetime64SeriesComparison:
],
)
@pytest.mark.parametrize("reverse", [True, False])
@pytest.mark.parametrize("box", [Series, pd.Index])
@pytest.mark.parametrize("dtype", [None, object])
def test_nat_comparisons(self, dtype, box, reverse, pair):
def test_nat_comparisons(self, dtype, index_or_series, reverse, pair):
box = index_or_series
l, r = pair
if reverse:
# add lhs / rhs switched data
Expand Down Expand Up @@ -2383,14 +2383,16 @@ def test_dti_add_series(self, tz, names):
result4 = index + ser.values
tm.assert_index_equal(result4, expected)

@pytest.mark.parametrize("other_box", [pd.Index, Series])
@pytest.mark.parametrize("op", [operator.add, roperator.radd, operator.sub])
@pytest.mark.parametrize(
"names", [(None, None, None), ("foo", "bar", None), ("foo", "foo", "foo")]
)
def test_dti_addsub_offset_arraylike(self, tz_naive_fixture, names, op, other_box):
def test_dti_addsub_offset_arraylike(
self, tz_naive_fixture, names, op, index_or_series
):
# GH#18849, GH#19744
box = pd.Index
other_box = index_or_series
from .test_timedelta64 import get_upcast_box

tz = tz_naive_fixture
Expand Down