@@ -505,33 +505,25 @@ def test_tdi_add_dt64_array(self, box_df_broadcast_failure):
505505 # ------------------------------------------------------------------
506506 # Operations with int-like others
507507
508- def test_td64arr_add_int_series_invalid (self , box_df_broadcast_failure ,
509- tdser ):
510- box = box_df_broadcast_failure
508+ def test_td64arr_add_int_series_invalid (self , box , tdser ):
511509 tdser = tm .box_expected (tdser , box )
512510 err = TypeError if box is not pd .Index else NullFrequencyError
513511 with pytest .raises (err ):
514512 tdser + Series ([2 , 3 , 4 ])
515513
516- def test_td64arr_radd_int_series_invalid (self , box_df_broadcast_failure ,
517- tdser ):
518- box = box_df_broadcast_failure
514+ def test_td64arr_radd_int_series_invalid (self , box , tdser ):
519515 tdser = tm .box_expected (tdser , box )
520516 err = TypeError if box is not pd .Index else NullFrequencyError
521517 with pytest .raises (err ):
522518 Series ([2 , 3 , 4 ]) + tdser
523519
524- def test_td64arr_sub_int_series_invalid (self , box_df_broadcast_failure ,
525- tdser ):
526- box = box_df_broadcast_failure
520+ def test_td64arr_sub_int_series_invalid (self , box , tdser ):
527521 tdser = tm .box_expected (tdser , box )
528522 err = TypeError if box is not pd .Index else NullFrequencyError
529523 with pytest .raises (err ):
530524 tdser - Series ([2 , 3 , 4 ])
531525
532- def test_td64arr_rsub_int_series_invalid (self , box_df_broadcast_failure ,
533- tdser ):
534- box = box_df_broadcast_failure
526+ def test_td64arr_rsub_int_series_invalid (self , box , tdser ):
535527 tdser = tm .box_expected (tdser , box )
536528 err = TypeError if box is not pd .Index else NullFrequencyError
537529 with pytest .raises (err ):
@@ -605,9 +597,10 @@ def test_td64arr_add_sub_numeric_scalar_invalid(self, box, scalar, tdser):
605597 Series ([1 , 2 , 3 ])
606598 # TODO: Add DataFrame in here?
607599 ], ids = lambda x : type (x ).__name__ )
608- def test_td64arr_add_sub_numeric_arr_invalid (
609- self , box_df_broadcast_failure , vec , dtype , tdser ):
610- box = box_df_broadcast_failure
600+ def test_td64arr_add_sub_numeric_arr_invalid (self , box , vec , dtype , tdser ):
601+ if box is pd .DataFrame and not isinstance (vec , Series ):
602+ raise pytest .xfail (reason = "Tries to broadcast incorrectly" )
603+
611604 tdser = tm .box_expected (tdser , box )
612605 err = TypeError
613606 if box is pd .Index and not dtype .startswith ('float' ):
@@ -930,9 +923,9 @@ def test_td64arr_sub_offset_array(self, box_df_broadcast_failure):
930923 @pytest .mark .parametrize ('names' , [(None , None , None ),
931924 ('foo' , 'bar' , None ),
932925 ('foo' , 'foo' , 'foo' )])
933- def test_td64arr_with_offset_series (self , names , box_df_broadcast_failure ):
926+ def test_td64arr_with_offset_series (self , names , box_df_fail ):
934927 # GH#18849
935- box = box_df_broadcast_failure
928+ box = box_df_fail
936929 box2 = Series if box is pd .Index else box
937930
938931 tdi = TimedeltaIndex (['1 days 00:00:00' , '3 days 04:00:00' ],
@@ -963,10 +956,11 @@ def test_td64arr_with_offset_series(self, names, box_df_broadcast_failure):
963956 tm .assert_equal (res3 , expected_sub )
964957
965958 @pytest .mark .parametrize ('obox' , [np .array , pd .Index , pd .Series ])
966- def test_td64arr_addsub_anchored_offset_arraylike (
967- self , obox , box_df_broadcast_failure ):
959+ def test_td64arr_addsub_anchored_offset_arraylike (self , obox , box ):
968960 # GH#18824
969- box = box_df_broadcast_failure
961+ if box is pd .DataFrame and obox is not pd .Series :
962+ raise pytest .xfail (reason = "Attempts to broadcast incorrectly" )
963+
970964 tdi = TimedeltaIndex (['1 days 00:00:00' , '3 days 04:00:00' ])
971965 tdi = tm .box_expected (tdi , box )
972966
0 commit comments