@@ -814,17 +814,17 @@ def test_mi_sparse_column_names(self):
814814 def test_hide_single_index (self ):
815815 # single unnamed index
816816 ctx = self .df .style ._translate ()
817- self . assertTrue (ctx ['body' ][0 ][0 ]['is_visible' ])
818- self . assertTrue (ctx ['head' ][0 ][0 ]['is_visible' ])
817+ assert (ctx ['body' ][0 ][0 ]['is_visible' ])
818+ assert (ctx ['head' ][0 ][0 ]['is_visible' ])
819819 ctx2 = self .df .style .hide_index ()._translate ()
820820 self .assertFalse (ctx2 ['body' ][0 ][0 ]['is_visible' ])
821821 self .assertFalse (ctx2 ['head' ][0 ][0 ]['is_visible' ])
822822
823823 # single named index
824824 ctx3 = self .df .set_index ('A' ).style ._translate ()
825- self . assertTrue (ctx3 ['body' ][0 ][0 ]['is_visible' ])
825+ assert (ctx3 ['body' ][0 ][0 ]['is_visible' ])
826826 self .assertEqual (len (ctx3 ['head' ]), 2 ) # 2 header levels
827- self . assertTrue (ctx3 ['head' ][0 ][0 ]['is_visible' ])
827+ assert (ctx3 ['head' ][0 ][0 ]['is_visible' ])
828828
829829 ctx4 = self .df .set_index ('A' ).style .hide_index ()._translate ()
830830 self .assertFalse (ctx4 ['body' ][0 ][0 ]['is_visible' ])
@@ -838,11 +838,11 @@ def test_hide_multiindex(self):
838838 )
839839 ctx1 = df .style ._translate ()
840840 # tests for 'a' and '0'
841- self . assertTrue (ctx1 ['body' ][0 ][0 ]['is_visible' ])
842- self . assertTrue (ctx1 ['body' ][0 ][1 ]['is_visible' ])
841+ assert (ctx1 ['body' ][0 ][0 ]['is_visible' ])
842+ assert (ctx1 ['body' ][0 ][1 ]['is_visible' ])
843843 # check for blank header rows
844- self . assertTrue (ctx1 ['head' ][0 ][0 ]['is_visible' ])
845- self . assertTrue (ctx1 ['head' ][0 ][1 ]['is_visible' ])
844+ assert (ctx1 ['head' ][0 ][0 ]['is_visible' ])
845+ assert (ctx1 ['head' ][0 ][1 ]['is_visible' ])
846846
847847 ctx2 = df .style .hide_index ()._translate ()
848848 # tests for 'a' and '0'
@@ -855,17 +855,17 @@ def test_hide_multiindex(self):
855855 def test_hide_columns_single_level (self ):
856856 # test hiding single column
857857 ctx = self .df .style ._translate ()
858- self . assertTrue (ctx ['head' ][0 ][1 ]['is_visible' ])
858+ assert (ctx ['head' ][0 ][1 ]['is_visible' ])
859859 self .assertEqual (ctx ['head' ][0 ][1 ]['display_value' ], 'A' )
860- self . assertTrue (ctx ['head' ][0 ][2 ]['is_visible' ])
860+ assert (ctx ['head' ][0 ][2 ]['is_visible' ])
861861 self .assertEqual (ctx ['head' ][0 ][2 ]['display_value' ], 'B' )
862- self . assertTrue (ctx ['body' ][0 ][1 ]['is_visible' ]) # col A, row 1
863- self . assertTrue (ctx ['body' ][1 ][2 ]['is_visible' ]) # col B, row 1
862+ assert (ctx ['body' ][0 ][1 ]['is_visible' ]) # col A, row 1
863+ assert (ctx ['body' ][1 ][2 ]['is_visible' ]) # col B, row 1
864864
865865 ctx = self .df .style .hide_columns ('A' )._translate ()
866866 self .assertFalse (ctx ['head' ][0 ][1 ]['is_visible' ])
867867 self .assertFalse (ctx ['body' ][0 ][1 ]['is_visible' ]) # col A, row 1
868- self . assertTrue (ctx ['body' ][1 ][2 ]['is_visible' ]) # col B, row 1
868+ assert (ctx ['body' ][1 ][2 ]['is_visible' ]) # col B, row 1
869869
870870 # test hiding mulitiple columns
871871 ctx = self .df .style .hide_columns (['A' , 'B' ])._translate ()
@@ -885,40 +885,40 @@ def test_hide_columns_mult_levels(self):
885885 df = pd .DataFrame ([[1 , 2 ], [3 , 4 ]], index = i1 , columns = i2 )
886886 ctx = df .style ._translate ()
887887 # column headers
888- self . assertTrue (ctx ['head' ][0 ][2 ]['is_visible' ])
889- self . assertTrue (ctx ['head' ][1 ][2 ]['is_visible' ])
888+ assert (ctx ['head' ][0 ][2 ]['is_visible' ])
889+ assert (ctx ['head' ][1 ][2 ]['is_visible' ])
890890 self .assertEqual (ctx ['head' ][1 ][3 ]['display_value' ], 1 )
891891 # indices
892- self . assertTrue (ctx ['body' ][0 ][0 ]['is_visible' ])
892+ assert (ctx ['body' ][0 ][0 ]['is_visible' ])
893893 # data
894- self . assertTrue (ctx ['body' ][1 ][2 ]['is_visible' ])
894+ assert (ctx ['body' ][1 ][2 ]['is_visible' ])
895895 self .assertEqual (ctx ['body' ][1 ][2 ]['display_value' ], 3 )
896- self . assertTrue (ctx ['body' ][1 ][3 ]['is_visible' ])
896+ assert (ctx ['body' ][1 ][3 ]['is_visible' ])
897897 self .assertEqual (ctx ['body' ][1 ][3 ]['display_value' ], 4 )
898898
899899 # hide top column level, which hides both columns
900900 ctx = df .style .hide_columns ('b' )._translate ()
901901 self .assertFalse (ctx ['head' ][0 ][2 ]['is_visible' ]) # b
902902 self .assertFalse (ctx ['head' ][1 ][2 ]['is_visible' ]) # 0
903903 self .assertFalse (ctx ['body' ][1 ][2 ]['is_visible' ]) # 3
904- self . assertTrue (ctx ['body' ][0 ][0 ]['is_visible' ]) # index
904+ assert (ctx ['body' ][0 ][0 ]['is_visible' ]) # index
905905
906906 # hide first column only
907907 ctx = df .style .hide_columns ([('b' , 0 )])._translate ()
908- self . assertTrue (ctx ['head' ][0 ][2 ]['is_visible' ]) # b
908+ assert (ctx ['head' ][0 ][2 ]['is_visible' ]) # b
909909 self .assertFalse (ctx ['head' ][1 ][2 ]['is_visible' ]) # 0
910910 self .assertFalse (ctx ['body' ][1 ][2 ]['is_visible' ]) # 3
911- self . assertTrue (ctx ['body' ][1 ][3 ]['is_visible' ])
911+ assert (ctx ['body' ][1 ][3 ]['is_visible' ])
912912 self .assertEqual (ctx ['body' ][1 ][3 ]['display_value' ], 4 )
913913
914914 # hide second column and index
915915 ctx = df .style .hide_columns ([('b' , 1 )]).hide_index ()._translate ()
916916 self .assertFalse (ctx ['body' ][0 ][0 ]['is_visible' ]) # index
917- self . assertTrue (ctx ['head' ][0 ][2 ]['is_visible' ]) # b
918- self . assertTrue (ctx ['head' ][1 ][2 ]['is_visible' ]) # 0
917+ assert (ctx ['head' ][0 ][2 ]['is_visible' ]) # b
918+ assert (ctx ['head' ][1 ][2 ]['is_visible' ]) # 0
919919 self .assertFalse (ctx ['head' ][1 ][3 ]['is_visible' ]) # 1
920920 self .assertFalse (ctx ['body' ][1 ][3 ]['is_visible' ]) # 4
921- self . assertTrue (ctx ['body' ][1 ][2 ]['is_visible' ])
921+ assert (ctx ['body' ][1 ][2 ]['is_visible' ])
922922 self .assertEqual (ctx ['body' ][1 ][2 ]['display_value' ], 3 )
923923
924924
0 commit comments