@@ -355,13 +355,15 @@ def test_subtraction_ops(self):
355
355
expected = DatetimeIndex (["20121231" , NaT , "20121230" ], name = "foo" )
356
356
tm .assert_index_equal (result , expected )
357
357
358
- def test_subtraction_ops_with_tz (self ):
358
+ def test_subtraction_ops_with_tz (self , box_with_array ):
359
359
360
360
# check that dt/dti subtraction ops with tz are validated
361
361
dti = pd .date_range ("20130101" , periods = 3 )
362
+ dti = tm .box_expected (dti , box_with_array )
362
363
ts = Timestamp ("20130101" )
363
364
dt = ts .to_pydatetime ()
364
365
dti_tz = pd .date_range ("20130101" , periods = 3 ).tz_localize ("US/Eastern" )
366
+ dti_tz = tm .box_expected (dti_tz , box_with_array )
365
367
ts_tz = Timestamp ("20130101" ).tz_localize ("US/Eastern" )
366
368
ts_tz2 = Timestamp ("20130101" ).tz_localize ("CET" )
367
369
dt_tz = ts_tz .to_pydatetime ()
@@ -411,27 +413,32 @@ def _check(result, expected):
411
413
412
414
result = dti_tz - dt_tz
413
415
expected = TimedeltaIndex (["0 days" , "1 days" , "2 days" ])
414
- tm .assert_index_equal (result , expected )
416
+ expected = tm .box_expected (expected , box_with_array )
417
+ tm .assert_equal (result , expected )
415
418
416
419
result = dt_tz - dti_tz
417
420
expected = TimedeltaIndex (["0 days" , "-1 days" , "-2 days" ])
418
- tm .assert_index_equal (result , expected )
421
+ expected = tm .box_expected (expected , box_with_array )
422
+ tm .assert_equal (result , expected )
419
423
420
424
result = dti_tz - ts_tz
421
425
expected = TimedeltaIndex (["0 days" , "1 days" , "2 days" ])
422
- tm .assert_index_equal (result , expected )
426
+ expected = tm .box_expected (expected , box_with_array )
427
+ tm .assert_equal (result , expected )
423
428
424
429
result = ts_tz - dti_tz
425
430
expected = TimedeltaIndex (["0 days" , "-1 days" , "-2 days" ])
426
- tm .assert_index_equal (result , expected )
431
+ expected = tm .box_expected (expected , box_with_array )
432
+ tm .assert_equal (result , expected )
427
433
428
434
result = td - td
429
435
expected = Timedelta ("0 days" )
430
436
_check (result , expected )
431
437
432
438
result = dti_tz - td
433
439
expected = DatetimeIndex (["20121231" , "20130101" , "20130102" ], tz = "US/Eastern" )
434
- tm .assert_index_equal (result , expected )
440
+ expected = tm .box_expected (expected , box_with_array )
441
+ tm .assert_equal (result , expected )
435
442
436
443
def test_dti_tdi_numeric_ops (self ):
437
444
# These are normally union/diff set-like ops
0 commit comments