@@ -705,17 +705,17 @@ def test_mi_sparse_column_names(self):
705705 def test_hide_single_index (self ):
706706 # single unnamed index
707707 ctx = self .df .style ._translate ()
708- self . assertTrue (ctx ['body' ][0 ][0 ]['is_visible' ])
709- self . assertTrue (ctx ['head' ][0 ][0 ]['is_visible' ])
708+ assert (ctx ['body' ][0 ][0 ]['is_visible' ])
709+ assert (ctx ['head' ][0 ][0 ]['is_visible' ])
710710 ctx2 = self .df .style .hide_index ()._translate ()
711711 self .assertFalse (ctx2 ['body' ][0 ][0 ]['is_visible' ])
712712 self .assertFalse (ctx2 ['head' ][0 ][0 ]['is_visible' ])
713713
714714 # single named index
715715 ctx3 = self .df .set_index ('A' ).style ._translate ()
716- self . assertTrue (ctx3 ['body' ][0 ][0 ]['is_visible' ])
716+ assert (ctx3 ['body' ][0 ][0 ]['is_visible' ])
717717 self .assertEqual (len (ctx3 ['head' ]), 2 ) # 2 header levels
718- self . assertTrue (ctx3 ['head' ][0 ][0 ]['is_visible' ])
718+ assert (ctx3 ['head' ][0 ][0 ]['is_visible' ])
719719
720720 ctx4 = self .df .set_index ('A' ).style .hide_index ()._translate ()
721721 self .assertFalse (ctx4 ['body' ][0 ][0 ]['is_visible' ])
@@ -729,11 +729,11 @@ def test_hide_multiindex(self):
729729 )
730730 ctx1 = df .style ._translate ()
731731 # tests for 'a' and '0'
732- self . assertTrue (ctx1 ['body' ][0 ][0 ]['is_visible' ])
733- self . assertTrue (ctx1 ['body' ][0 ][1 ]['is_visible' ])
732+ assert (ctx1 ['body' ][0 ][0 ]['is_visible' ])
733+ assert (ctx1 ['body' ][0 ][1 ]['is_visible' ])
734734 # check for blank header rows
735- self . assertTrue (ctx1 ['head' ][0 ][0 ]['is_visible' ])
736- self . assertTrue (ctx1 ['head' ][0 ][1 ]['is_visible' ])
735+ assert (ctx1 ['head' ][0 ][0 ]['is_visible' ])
736+ assert (ctx1 ['head' ][0 ][1 ]['is_visible' ])
737737
738738 ctx2 = df .style .hide_index ()._translate ()
739739 # tests for 'a' and '0'
@@ -746,17 +746,17 @@ def test_hide_multiindex(self):
746746 def test_hide_columns_single_level (self ):
747747 # test hiding single column
748748 ctx = self .df .style ._translate ()
749- self . assertTrue (ctx ['head' ][0 ][1 ]['is_visible' ])
749+ assert (ctx ['head' ][0 ][1 ]['is_visible' ])
750750 self .assertEqual (ctx ['head' ][0 ][1 ]['display_value' ], 'A' )
751- self . assertTrue (ctx ['head' ][0 ][2 ]['is_visible' ])
751+ assert (ctx ['head' ][0 ][2 ]['is_visible' ])
752752 self .assertEqual (ctx ['head' ][0 ][2 ]['display_value' ], 'B' )
753- self . assertTrue (ctx ['body' ][0 ][1 ]['is_visible' ]) # col A, row 1
754- self . assertTrue (ctx ['body' ][1 ][2 ]['is_visible' ]) # col B, row 1
753+ assert (ctx ['body' ][0 ][1 ]['is_visible' ]) # col A, row 1
754+ assert (ctx ['body' ][1 ][2 ]['is_visible' ]) # col B, row 1
755755
756756 ctx = self .df .style .hide_columns ('A' )._translate ()
757757 self .assertFalse (ctx ['head' ][0 ][1 ]['is_visible' ])
758758 self .assertFalse (ctx ['body' ][0 ][1 ]['is_visible' ]) # col A, row 1
759- self . assertTrue (ctx ['body' ][1 ][2 ]['is_visible' ]) # col B, row 1
759+ assert (ctx ['body' ][1 ][2 ]['is_visible' ]) # col B, row 1
760760
761761 # test hiding mulitiple columns
762762 ctx = self .df .style .hide_columns (['A' , 'B' ])._translate ()
@@ -776,40 +776,40 @@ def test_hide_columns_mult_levels(self):
776776 df = pd .DataFrame ([[1 , 2 ], [3 , 4 ]], index = i1 , columns = i2 )
777777 ctx = df .style ._translate ()
778778 # column headers
779- self . assertTrue (ctx ['head' ][0 ][2 ]['is_visible' ])
780- self . assertTrue (ctx ['head' ][1 ][2 ]['is_visible' ])
779+ assert (ctx ['head' ][0 ][2 ]['is_visible' ])
780+ assert (ctx ['head' ][1 ][2 ]['is_visible' ])
781781 self .assertEqual (ctx ['head' ][1 ][3 ]['display_value' ], 1 )
782782 # indices
783- self . assertTrue (ctx ['body' ][0 ][0 ]['is_visible' ])
783+ assert (ctx ['body' ][0 ][0 ]['is_visible' ])
784784 # data
785- self . assertTrue (ctx ['body' ][1 ][2 ]['is_visible' ])
785+ assert (ctx ['body' ][1 ][2 ]['is_visible' ])
786786 self .assertEqual (ctx ['body' ][1 ][2 ]['display_value' ], 3 )
787- self . assertTrue (ctx ['body' ][1 ][3 ]['is_visible' ])
787+ assert (ctx ['body' ][1 ][3 ]['is_visible' ])
788788 self .assertEqual (ctx ['body' ][1 ][3 ]['display_value' ], 4 )
789789
790790 # hide top column level, which hides both columns
791791 ctx = df .style .hide_columns ('b' )._translate ()
792792 self .assertFalse (ctx ['head' ][0 ][2 ]['is_visible' ]) # b
793793 self .assertFalse (ctx ['head' ][1 ][2 ]['is_visible' ]) # 0
794794 self .assertFalse (ctx ['body' ][1 ][2 ]['is_visible' ]) # 3
795- self . assertTrue (ctx ['body' ][0 ][0 ]['is_visible' ]) # index
795+ assert (ctx ['body' ][0 ][0 ]['is_visible' ]) # index
796796
797797 # hide first column only
798798 ctx = df .style .hide_columns ([('b' , 0 )])._translate ()
799- self . assertTrue (ctx ['head' ][0 ][2 ]['is_visible' ]) # b
799+ assert (ctx ['head' ][0 ][2 ]['is_visible' ]) # b
800800 self .assertFalse (ctx ['head' ][1 ][2 ]['is_visible' ]) # 0
801801 self .assertFalse (ctx ['body' ][1 ][2 ]['is_visible' ]) # 3
802- self . assertTrue (ctx ['body' ][1 ][3 ]['is_visible' ])
802+ assert (ctx ['body' ][1 ][3 ]['is_visible' ])
803803 self .assertEqual (ctx ['body' ][1 ][3 ]['display_value' ], 4 )
804804
805805 # hide second column and index
806806 ctx = df .style .hide_columns ([('b' , 1 )]).hide_index ()._translate ()
807807 self .assertFalse (ctx ['body' ][0 ][0 ]['is_visible' ]) # index
808- self . assertTrue (ctx ['head' ][0 ][2 ]['is_visible' ]) # b
809- self . assertTrue (ctx ['head' ][1 ][2 ]['is_visible' ]) # 0
808+ assert (ctx ['head' ][0 ][2 ]['is_visible' ]) # b
809+ assert (ctx ['head' ][1 ][2 ]['is_visible' ]) # 0
810810 self .assertFalse (ctx ['head' ][1 ][3 ]['is_visible' ]) # 1
811811 self .assertFalse (ctx ['body' ][1 ][3 ]['is_visible' ]) # 4
812- self . assertTrue (ctx ['body' ][1 ][2 ]['is_visible' ])
812+ assert (ctx ['body' ][1 ][2 ]['is_visible' ])
813813 self .assertEqual (ctx ['body' ][1 ][2 ]['display_value' ], 3 )
814814
815815
0 commit comments