@@ -357,13 +357,15 @@ def test_subtraction_ops(self):
357357 expected = DatetimeIndex (["20121231" , NaT , "20121230" ], name = "foo" )
358358 tm .assert_index_equal (result , expected )
359359
360- def test_subtraction_ops_with_tz (self ):
360+ def test_subtraction_ops_with_tz (self , box_with_array ):
361361
362362 # check that dt/dti subtraction ops with tz are validated
363363 dti = pd .date_range ("20130101" , periods = 3 )
364+ dti = tm .box_expected (dti , box_with_array )
364365 ts = Timestamp ("20130101" )
365366 dt = ts .to_pydatetime ()
366367 dti_tz = pd .date_range ("20130101" , periods = 3 ).tz_localize ("US/Eastern" )
368+ dti_tz = tm .box_expected (dti_tz , box_with_array )
367369 ts_tz = Timestamp ("20130101" ).tz_localize ("US/Eastern" )
368370 ts_tz2 = Timestamp ("20130101" ).tz_localize ("CET" )
369371 dt_tz = ts_tz .to_pydatetime ()
@@ -413,27 +415,32 @@ def _check(result, expected):
413415
414416 result = dti_tz - dt_tz
415417 expected = TimedeltaIndex (["0 days" , "1 days" , "2 days" ])
416- tm .assert_index_equal (result , expected )
418+ expected = tm .box_expected (expected , box_with_array )
419+ tm .assert_equal (result , expected )
417420
418421 result = dt_tz - dti_tz
419422 expected = TimedeltaIndex (["0 days" , "-1 days" , "-2 days" ])
420- tm .assert_index_equal (result , expected )
423+ expected = tm .box_expected (expected , box_with_array )
424+ tm .assert_equal (result , expected )
421425
422426 result = dti_tz - ts_tz
423427 expected = TimedeltaIndex (["0 days" , "1 days" , "2 days" ])
424- tm .assert_index_equal (result , expected )
428+ expected = tm .box_expected (expected , box_with_array )
429+ tm .assert_equal (result , expected )
425430
426431 result = ts_tz - dti_tz
427432 expected = TimedeltaIndex (["0 days" , "-1 days" , "-2 days" ])
428- tm .assert_index_equal (result , expected )
433+ expected = tm .box_expected (expected , box_with_array )
434+ tm .assert_equal (result , expected )
429435
430436 result = td - td
431437 expected = Timedelta ("0 days" )
432438 _check (result , expected )
433439
434440 result = dti_tz - td
435441 expected = DatetimeIndex (["20121231" , "20130101" , "20130102" ], tz = "US/Eastern" )
436- tm .assert_index_equal (result , expected )
442+ expected = tm .box_expected (expected , box_with_array )
443+ tm .assert_equal (result , expected )
437444
438445 def test_dti_tdi_numeric_ops (self ):
439446 # These are normally union/diff set-like ops
0 commit comments