@@ -104,8 +104,7 @@ def test_eng_float_formatter(self):
104104
105105 fmt .set_eng_float_format (accuracy = 0 )
106106 repr (self .frame )
107-
108- fmt .reset_option ('^display.' )
107+ self .reset_display_options ()
109108
110109 def test_repr_tuples (self ):
111110 buf = StringIO ()
@@ -1034,7 +1033,7 @@ def test_to_string_no_index(self):
10341033 assert (df_s == expected )
10351034
10361035 def test_to_string_float_formatting (self ):
1037- fmt . reset_option ( '^display.' )
1036+ self . reset_display_options ( )
10381037 fmt .set_option ('display.precision' , 6 , 'display.column_space' ,
10391038 12 , 'display.notebook_repr_html' , False )
10401039
@@ -1065,7 +1064,7 @@ def test_to_string_float_formatting(self):
10651064 '1 0.253' )
10661065 assert (df_s == expected )
10671066
1068- fmt . reset_option ( '^display.' )
1067+ self . reset_display_options ( )
10691068 self .assertEqual (get_option ("display.precision" ), 7 )
10701069
10711070 df = DataFrame ({'x' : [1e9 , 0.2512 ]})
@@ -1157,7 +1156,7 @@ def test_to_string_index_formatter(self):
11571156 self .assertEqual (rs , xp )
11581157
11591158 def test_to_string_left_justify_cols (self ):
1160- fmt . reset_option ( '^display.' )
1159+ self . reset_display_options ( )
11611160 df = DataFrame ({'x' : [3234 , 0.253 ]})
11621161 df_s = df .to_string (justify = 'left' )
11631162 expected = (' x \n '
@@ -1166,7 +1165,7 @@ def test_to_string_left_justify_cols(self):
11661165 assert (df_s == expected )
11671166
11681167 def test_to_string_format_na (self ):
1169- fmt . reset_option ( '^display.' )
1168+ self . reset_display_options ( )
11701169 df = DataFrame ({'A' : [np .nan , - 1 , - 2.1234 , 3 , 4 ],
11711170 'B' : [np .nan , 'foo' , 'foooo' , 'fooooo' , 'bar' ]})
11721171 result = df .to_string ()
@@ -1434,14 +1433,14 @@ def test_repr_html(self):
14341433 fmt .set_option ('display.notebook_repr_html' , False )
14351434 self .frame ._repr_html_ ()
14361435
1437- fmt . reset_option ( '^display.' )
1436+ self . reset_display_options ( )
14381437
14391438 df = DataFrame ([[1 , 2 ], [3 , 4 ]])
14401439 self .assertTrue ('2 rows' in df ._repr_html_ ())
14411440 fmt .set_option ('display.show_dimensions' , False )
14421441 self .assertFalse ('2 rows' in df ._repr_html_ ())
14431442
1444- fmt . reset_option ( '^display.' )
1443+ self . reset_display_options ( )
14451444
14461445 def test_repr_html_wide (self ):
14471446 row = lambda l , k : [tm .rands (k ) for _ in range (l )]
@@ -1580,7 +1579,7 @@ def get_ipython():
15801579 repstr = self .frame ._repr_html_ ()
15811580 self .assertIn ('class' , repstr ) # info fallback
15821581
1583- fmt . reset_option ( '^display.' )
1582+ self . reset_display_options ( )
15841583
15851584 def test_to_html_with_classes (self ):
15861585 df = pandas .DataFrame ()
@@ -2092,7 +2091,7 @@ def test_eng_float_formatter(self):
20922091 '3 1E+06' )
20932092 self .assertEqual (result , expected )
20942093
2095- fmt . reset_option ( '^display.' )
2094+ self . reset_display_options ( )
20962095
20972096 def compare (self , formatter , input , output ):
20982097 formatted_input = formatter (input )
0 commit comments