@@ -1037,10 +1037,10 @@ def test_dti_add_sub_float(self, op, other):
1037
1037
with pytest .raises (TypeError ):
1038
1038
op (dti , other )
1039
1039
1040
- def test_dti_add_timestamp_raises (self , box ):
1040
+ def test_dti_add_timestamp_raises (self , box_with_datetime ):
1041
1041
# GH#22163 ensure DataFrame doesn't cast Timestamp to i8
1042
1042
idx = DatetimeIndex (['2011-01-01' , '2011-01-02' ])
1043
- idx = tm .box_expected (idx , box )
1043
+ idx = tm .box_expected (idx , box_with_datetime )
1044
1044
msg = "cannot add"
1045
1045
with tm .assert_raises_regex (TypeError , msg ):
1046
1046
idx + Timestamp ('2011-01-01' )
@@ -1152,16 +1152,17 @@ def test_dti_add_intarray_no_freq(self, box):
1152
1152
# -------------------------------------------------------------
1153
1153
# Binary operations DatetimeIndex and timedelta-like
1154
1154
1155
- def test_dti_add_timedeltalike (self , tz_naive_fixture , two_hours , box ):
1155
+ def test_dti_add_timedeltalike (self , tz_naive_fixture , two_hours ,
1156
+ box_with_datetime ):
1156
1157
# GH#22005, GH#22163 check DataFrame doesn't raise TypeError
1157
1158
tz = tz_naive_fixture
1158
1159
rng = pd .date_range ('2000-01-01' , '2000-02-01' , tz = tz )
1159
- rng = tm .box_expected (rng , box )
1160
+ rng = tm .box_expected (rng , box_with_datetime )
1160
1161
1161
1162
result = rng + two_hours
1162
1163
expected = pd .date_range ('2000-01-01 02:00' ,
1163
1164
'2000-02-01 02:00' , tz = tz )
1164
- expected = tm .box_expected (expected , box )
1165
+ expected = tm .box_expected (expected , box_with_datetime )
1165
1166
tm .assert_equal (result , expected )
1166
1167
1167
1168
def test_dti_iadd_timedeltalike (self , tz_naive_fixture , two_hours ):
@@ -1431,13 +1432,13 @@ def test_sub_dti_dti(self):
1431
1432
tm .assert_index_equal (result , expected )
1432
1433
1433
1434
@pytest .mark .parametrize ('freq' , [None , 'D' ])
1434
- def test_sub_period (self , freq , box ):
1435
+ def test_sub_period (self , freq , box_with_datetime ):
1435
1436
# GH#13078
1436
1437
# not supported, check TypeError
1437
1438
p = pd .Period ('2011-01-01' , freq = 'D' )
1438
1439
1439
1440
idx = pd .DatetimeIndex (['2011-01-01' , '2011-01-02' ], freq = freq )
1440
- idx = tm .box_expected (idx , box )
1441
+ idx = tm .box_expected (idx , box_with_datetime )
1441
1442
1442
1443
with pytest .raises (TypeError ):
1443
1444
idx - p
@@ -1779,7 +1780,7 @@ def test_dti_with_offset_series(self, tz_naive_fixture, names):
1779
1780
res3 = dti - other
1780
1781
tm .assert_series_equal (res3 , expected_sub )
1781
1782
1782
- def test_dti_add_offset_tzaware (self , tz_aware_fixture , box ):
1783
+ def test_dti_add_offset_tzaware (self , tz_aware_fixture , box_with_datetime ):
1783
1784
# GH#21610, GH#22163 ensure DataFrame doesn't return object-dtype
1784
1785
timezone = tz_aware_fixture
1785
1786
if timezone == 'US/Pacific' :
@@ -1792,8 +1793,8 @@ def test_dti_add_offset_tzaware(self, tz_aware_fixture, box):
1792
1793
expected = DatetimeIndex (['2010-11-01 05:00' , '2010-11-01 06:00' ,
1793
1794
'2010-11-01 07:00' ], freq = 'H' , tz = timezone )
1794
1795
1795
- dates = tm .box_expected (dates , box )
1796
- expected = tm .box_expected (expected , box )
1796
+ dates = tm .box_expected (dates , box_with_datetime )
1797
+ expected = tm .box_expected (expected , box_with_datetime )
1797
1798
1798
1799
# TODO: parametrize over the scalar being added? radd? sub?
1799
1800
offset = dates + pd .offsets .Hour (5 )
0 commit comments