@@ -834,7 +834,6 @@ def test_append_preserve_index_name(self):
834834 @pytest .mark .parametrize ("df_columns" , [
835835 pd .RangeIndex (3 ),
836836 pd .CategoricalIndex ('A B C' .split ()),
837- pd .CategoricalIndex ('A B C' .split (), ordered = True ),
838837 pd .MultiIndex .from_arrays (['A B C' .split (), 'D E F' .split ()]),
839838 pd .IntervalIndex .from_breaks ([0 , 1 , 2 , 3 ]),
840839 pd .DatetimeIndex ([dt .datetime (2013 , 1 , 3 , 0 , 0 ),
@@ -913,10 +912,8 @@ def test_append_multi_index_raises(self, other_type):
913912
914913 df = pd .DataFrame ([[1 , 2 , 3 ], [4 , 5 , 6 ]], columns = mi )
915914 ser = pd .Series ([7 , 8 , 9 ], index = other_type , name = 2 )
916- if isinstance (other_type , pd .IntervalIndex ):
917- pytest .raises (ValueError , df .append , ser )
918- else :
919- pytest .raises (TypeError , df .append , ser )
915+ with pytest .raises (TypeError ):
916+ df .append (ser )
920917
921918 df = pd .DataFrame ([[1 , 2 , 3 ], [4 , 5 , 6 ]], columns = other_type )
922919 ser = pd .Series ([7 , 8 , 9 ], index = mi , name = 2 )
@@ -947,7 +944,7 @@ def test_append_interval_index_raises(self, other_type):
947944
948945 df = pd .DataFrame ([[1 , 2 , 3 ], [4 , 5 , 6 ]], columns = other_type )
949946 ser = pd .Series ([7 , 8 , 9 ], index = ii , name = 2 )
950- with pytest .raises (ValueError ):
947+ with pytest .raises (TypeError ):
951948 df .append (ser )
952949
953950 def test_append_dtype_coerce (self ):
0 commit comments