Skip to content

Commit 881ccdc

Browse files
ivanovmgKevin D Smith
authored and
Kevin D Smith
committed
CLN: de-duplicate in arithmetic/test_numeric (pandas-dev#37215)
1 parent b06d260 commit 881ccdc

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

pandas/tests/arithmetic/test_numeric.py

+4-11
Original file line numberDiff line numberDiff line change
@@ -172,31 +172,24 @@ def test_div_td64arr(self, left, box_cls):
172172
with pytest.raises(TypeError, match=msg):
173173
left // right
174174

175-
# TODO: de-duplicate with test_numeric_arr_mul_tdscalar
176-
def test_ops_series(self):
177-
# regression test for G#H8813
178-
td = Timedelta("1 day")
179-
other = pd.Series([1, 2])
180-
expected = pd.Series(pd.to_timedelta(["1 day", "2 days"]))
181-
tm.assert_series_equal(expected, td * other)
182-
tm.assert_series_equal(expected, other * td)
183-
184-
# TODO: also test non-nanosecond timedelta64 and Tick objects;
175+
# TODO: also test Tick objects;
185176
# see test_numeric_arr_rdiv_tdscalar for note on these failing
186177
@pytest.mark.parametrize(
187178
"scalar_td",
188179
[
189180
Timedelta(days=1),
190181
Timedelta(days=1).to_timedelta64(),
191182
Timedelta(days=1).to_pytimedelta(),
183+
Timedelta(days=1).to_timedelta64().astype("timedelta64[s]"),
184+
Timedelta(days=1).to_timedelta64().astype("timedelta64[ms]"),
192185
],
193186
ids=lambda x: type(x).__name__,
194187
)
195188
def test_numeric_arr_mul_tdscalar(self, scalar_td, numeric_idx, box_with_array):
196189
# GH#19333
197190
box = box_with_array
198191
index = numeric_idx
199-
expected = pd.TimedeltaIndex([pd.Timedelta(days=n) for n in range(5)])
192+
expected = pd.TimedeltaIndex([pd.Timedelta(days=n) for n in range(len(index))])
200193

201194
index = tm.box_expected(index, box)
202195
expected = tm.box_expected(expected, box)

0 commit comments

Comments
 (0)