@@ -295,7 +295,7 @@ def _check(op):
295295 index_result = op (index , element )
296296
297297 tm .assert_isinstance (index_result , np .ndarray )
298- self .assert_ ( not isinstance ( index_result , Index ) )
298+ self .assertNotIsInstance ( index_result , Index )
299299 self .assert_numpy_array_equal (arr_result , index_result )
300300
301301 _check (operator .eq )
@@ -762,7 +762,7 @@ def test_boolean_cmp(self):
762762
763763 self .assert_ (res .all ())
764764 self .assertEqual (res .dtype , 'bool' )
765- self .assert_ ( not isinstance ( res , Index ) )
765+ self .assertNotIsInstance ( res , Index )
766766
767767 def test_get_level_values (self ):
768768 result = self .strIndex .get_level_values (0 )
@@ -808,35 +808,36 @@ def test_repr_roundtrip(self):
808808 tm .assert_index_equal (eval (repr (ind )), ind )
809809
810810 def check_is_index (self , i ):
811- self .assert_ (isinstance (i , Index ) and not isinstance (i , Float64Index ))
811+ self .assertIsInstance (i , Index )
812+ self .assertNotIsInstance (i , Float64Index )
812813
813814 def check_coerce (self , a , b , is_float_index = True ):
814815 self .assert_ (a .equals (b ))
815816 if is_float_index :
816- self .assert_ ( isinstance ( b , Float64Index ) )
817+ self .assertIsInstance ( b , Float64Index )
817818 else :
818819 self .check_is_index (b )
819820
820821 def test_constructor (self ):
821822
822823 # explicit construction
823824 index = Float64Index ([1 ,2 ,3 ,4 ,5 ])
824- self .assert_ ( isinstance ( index , Float64Index ) )
825+ self .assertIsInstance ( index , Float64Index )
825826 self .assert_ ((index .values == np .array ([1 ,2 ,3 ,4 ,5 ],dtype = 'float64' )).all ())
826827 index = Float64Index (np .array ([1 ,2 ,3 ,4 ,5 ]))
827- self .assert_ ( isinstance ( index , Float64Index ) )
828+ self .assertIsInstance ( index , Float64Index )
828829 index = Float64Index ([1. ,2 ,3 ,4 ,5 ])
829- self .assert_ ( isinstance ( index , Float64Index ) )
830+ self .assertIsInstance ( index , Float64Index )
830831 index = Float64Index (np .array ([1. ,2 ,3 ,4 ,5 ]))
831- self .assert_ ( isinstance ( index , Float64Index ) )
832+ self .assertIsInstance ( index , Float64Index )
832833 self .assertEqual (index .dtype , object )
833834
834835 index = Float64Index (np .array ([1. ,2 ,3 ,4 ,5 ]),dtype = np .float32 )
835- self .assert_ ( isinstance ( index , Float64Index ) )
836+ self .assertIsInstance ( index , Float64Index )
836837 self .assertEqual (index .dtype , object )
837838
838839 index = Float64Index (np .array ([1 ,2 ,3 ,4 ,5 ]),dtype = np .float32 )
839- self .assert_ ( isinstance ( index , Float64Index ) )
840+ self .assertIsInstance ( index , Float64Index )
840841 self .assertEqual (index .dtype , object )
841842
842843 # nan handling
@@ -1548,7 +1549,7 @@ def test_constructor_single_level(self):
15481549 labels = [[0 , 1 , 2 , 3 ]],
15491550 names = ['first' ])
15501551 tm .assert_isinstance (single_level , Index )
1551- self .assert_ ( not isinstance ( single_level , MultiIndex ) )
1552+ self .assertNotIsInstance ( single_level , MultiIndex )
15521553 self .assertEqual (single_level .name , 'first' )
15531554
15541555 single_level = MultiIndex (levels = [['foo' , 'bar' , 'baz' , 'qux' ]],
0 commit comments