@@ -141,16 +141,16 @@ def test_repr_truncation(self):
141141 def test_repr_chop_threshold (self ):
142142 df = DataFrame ([[0.1 , 0.5 ],[0.5 , - 0.1 ]])
143143 pd .reset_option ("display.chop_threshold" ) # default None
144- self .assertEqual (repr (df ), ' 0 1\n 0 0.1 0.5\n 1 0.5 -0.1\n \n [2 rows x 2 columns] ' )
144+ self .assertEqual (repr (df ), ' 0 1\n 0 0.1 0.5\n 1 0.5 -0.1' )
145145
146146 with option_context ("display.chop_threshold" , 0.2 ):
147- self .assertEqual (repr (df ), ' 0 1\n 0 0.0 0.5\n 1 0.5 0.0\n \n [2 rows x 2 columns] ' )
147+ self .assertEqual (repr (df ), ' 0 1\n 0 0.0 0.5\n 1 0.5 0.0' )
148148
149149 with option_context ("display.chop_threshold" , 0.6 ):
150- self .assertEqual (repr (df ), ' 0 1\n 0 0 0\n 1 0 0\n \n [2 rows x 2 columns] ' )
150+ self .assertEqual (repr (df ), ' 0 1\n 0 0 0\n 1 0 0' )
151151
152152 with option_context ("display.chop_threshold" , None ):
153- self .assertEqual (repr (df ), ' 0 1\n 0 0.1 0.5\n 1 0.5 -0.1\n \n [2 rows x 2 columns] ' )
153+ self .assertEqual (repr (df ), ' 0 1\n 0 0.1 0.5\n 1 0.5 -0.1' )
154154
155155 def test_repr_obeys_max_seq_limit (self ):
156156 import pandas .core .common as com
@@ -197,7 +197,8 @@ def test_expand_frame_repr(self):
197197 with option_context ('mode.sim_interactive' , True ):
198198 with option_context ('display.max_columns' , 10 ,
199199 'display.width' ,20 ,
200- 'display.max_rows' , 20 ):
200+ 'display.max_rows' , 20 ,
201+ 'display.show_dimensions' , True ):
201202 with option_context ('display.expand_frame_repr' , True ):
202203 self .assertFalse (has_truncated_repr (df_small ))
203204 self .assertFalse (has_expanded_repr (df_small ))
@@ -789,7 +790,7 @@ def test_pprint_thing(self):
789790 self .assertTrue (not "\t " in pp_t ("a\t b" , escape_chars = ("\t " ,)))
790791
791792 def test_wide_repr (self ):
792- with option_context ('mode.sim_interactive' , True ):
793+ with option_context ('mode.sim_interactive' , True , 'display.show_dimensions' , True ):
793794 col = lambda l , k : [tm .rands (k ) for _ in range (l )]
794795 max_cols = get_option ('display.max_columns' )
795796 df = DataFrame ([col (max_cols - 1 , 25 ) for _ in range (10 )])
@@ -812,7 +813,7 @@ def test_wide_repr_wide_columns(self):
812813 df = DataFrame (randn (5 , 3 ), columns = ['a' * 90 , 'b' * 90 , 'c' * 90 ])
813814 rep_str = repr (df )
814815
815- self .assertEqual (len (rep_str .splitlines ()), 22 )
816+ self .assertEqual (len (rep_str .splitlines ()), 20 )
816817
817818 def test_wide_repr_named (self ):
818819 with option_context ('mode.sim_interactive' , True ):
@@ -1458,6 +1459,7 @@ def test_repr_html(self):
14581459 self .reset_display_options ()
14591460
14601461 df = DataFrame ([[1 , 2 ], [3 , 4 ]])
1462+ fmt .set_option ('display.show_dimensions' , True )
14611463 self .assertTrue ('2 rows' in df ._repr_html_ ())
14621464 fmt .set_option ('display.show_dimensions' , False )
14631465 self .assertFalse ('2 rows' in df ._repr_html_ ())
0 commit comments