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