@@ -1037,10 +1037,10 @@ def test_dti_add_sub_float(self, op, other):
10371037 with pytest .raises (TypeError ):
10381038 op (dti , other )
10391039
1040- def test_dti_add_timestamp_raises (self , box ):
1040+ def test_dti_add_timestamp_raises (self , box_with_datetime ):
10411041 # GH#22163 ensure DataFrame doesn't cast Timestamp to i8
10421042 idx = DatetimeIndex (['2011-01-01' , '2011-01-02' ])
1043- idx = tm .box_expected (idx , box )
1043+ idx = tm .box_expected (idx , box_with_datetime )
10441044 msg = "cannot add"
10451045 with tm .assert_raises_regex (TypeError , msg ):
10461046 idx + Timestamp ('2011-01-01' )
@@ -1152,16 +1152,17 @@ def test_dti_add_intarray_no_freq(self, box):
11521152 # -------------------------------------------------------------
11531153 # Binary operations DatetimeIndex and timedelta-like
11541154
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 ):
11561157 # GH#22005, GH#22163 check DataFrame doesn't raise TypeError
11571158 tz = tz_naive_fixture
11581159 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 )
11601161
11611162 result = rng + two_hours
11621163 expected = pd .date_range ('2000-01-01 02:00' ,
11631164 '2000-02-01 02:00' , tz = tz )
1164- expected = tm .box_expected (expected , box )
1165+ expected = tm .box_expected (expected , box_with_datetime )
11651166 tm .assert_equal (result , expected )
11661167
11671168 def test_dti_iadd_timedeltalike (self , tz_naive_fixture , two_hours ):
@@ -1431,13 +1432,13 @@ def test_sub_dti_dti(self):
14311432 tm .assert_index_equal (result , expected )
14321433
14331434 @pytest .mark .parametrize ('freq' , [None , 'D' ])
1434- def test_sub_period (self , freq , box ):
1435+ def test_sub_period (self , freq , box_with_datetime ):
14351436 # GH#13078
14361437 # not supported, check TypeError
14371438 p = pd .Period ('2011-01-01' , freq = 'D' )
14381439
14391440 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 )
14411442
14421443 with pytest .raises (TypeError ):
14431444 idx - p
@@ -1779,7 +1780,7 @@ def test_dti_with_offset_series(self, tz_naive_fixture, names):
17791780 res3 = dti - other
17801781 tm .assert_series_equal (res3 , expected_sub )
17811782
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 ):
17831784 # GH#21610, GH#22163 ensure DataFrame doesn't return object-dtype
17841785 timezone = tz_aware_fixture
17851786 if timezone == 'US/Pacific' :
@@ -1792,8 +1793,8 @@ def test_dti_add_offset_tzaware(self, tz_aware_fixture, box):
17921793 expected = DatetimeIndex (['2010-11-01 05:00' , '2010-11-01 06:00' ,
17931794 '2010-11-01 07:00' ], freq = 'H' , tz = timezone )
17941795
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 )
17971798
17981799 # TODO: parametrize over the scalar being added? radd? sub?
17991800 offset = dates + pd .offsets .Hour (5 )
0 commit comments