@@ -686,6 +686,10 @@ def test_add(self):
686
686
# - API change GH 8226
687
687
with tm .assert_produces_warning ():
688
688
self .strIndex + self .strIndex
689
+ with tm .assert_produces_warning ():
690
+ self .strIndex + self .strIndex .tolist ()
691
+ with tm .assert_produces_warning ():
692
+ self .strIndex .tolist () + self .strIndex
689
693
690
694
firstCat = self .strIndex .union (self .dateIndex )
691
695
secondCat = self .strIndex .union (self .strIndex )
@@ -772,6 +776,7 @@ def test_difference(self):
772
776
assertRaisesRegexp (TypeError , "iterable" , first .difference , 0.5 )
773
777
774
778
def test_symmetric_diff (self ):
779
+
775
780
# smoke
776
781
idx1 = Index ([1 , 2 , 3 , 4 ], name = 'idx1' )
777
782
idx2 = Index ([2 , 3 , 4 , 5 ])
@@ -819,7 +824,7 @@ def test_symmetric_diff(self):
819
824
820
825
# other isn't iterable
821
826
with tm .assertRaises (TypeError ):
822
- Index (idx1 ,dtype = 'object' ) - 1
827
+ Index (idx1 ,dtype = 'object' ). difference ( 1 )
823
828
824
829
def test_is_numeric (self ):
825
830
self .assertFalse (self .dateIndex .is_numeric ())
@@ -3899,8 +3904,8 @@ def test_difference(self):
3899
3904
self .index [- 3 :] - first
3900
3905
with tm .assert_produces_warning ():
3901
3906
self .index [- 3 :] - first .tolist ()
3902
- with tm . assert_produces_warning ():
3903
- first .tolist () - self .index [- 3 :]
3907
+
3908
+ self . assertRaises ( TypeError , lambda : first .tolist () - self .index [- 3 :])
3904
3909
3905
3910
expected = MultiIndex .from_tuples (sorted (self .index [:- 3 ].values ),
3906
3911
sortorder = 0 ,
0 commit comments