@@ -104,8 +104,7 @@ def test_eng_float_formatter(self):
104
104
105
105
fmt .set_eng_float_format (accuracy = 0 )
106
106
repr (self .frame )
107
-
108
- fmt .reset_option ('^display.' )
107
+ self .reset_display_options ()
109
108
110
109
def test_repr_tuples (self ):
111
110
buf = StringIO ()
@@ -1034,7 +1033,7 @@ def test_to_string_no_index(self):
1034
1033
assert (df_s == expected )
1035
1034
1036
1035
def test_to_string_float_formatting (self ):
1037
- fmt . reset_option ( '^display.' )
1036
+ self . reset_display_options ( )
1038
1037
fmt .set_option ('display.precision' , 6 , 'display.column_space' ,
1039
1038
12 , 'display.notebook_repr_html' , False )
1040
1039
@@ -1065,7 +1064,7 @@ def test_to_string_float_formatting(self):
1065
1064
'1 0.253' )
1066
1065
assert (df_s == expected )
1067
1066
1068
- fmt . reset_option ( '^display.' )
1067
+ self . reset_display_options ( )
1069
1068
self .assertEqual (get_option ("display.precision" ), 7 )
1070
1069
1071
1070
df = DataFrame ({'x' : [1e9 , 0.2512 ]})
@@ -1157,7 +1156,7 @@ def test_to_string_index_formatter(self):
1157
1156
self .assertEqual (rs , xp )
1158
1157
1159
1158
def test_to_string_left_justify_cols (self ):
1160
- fmt . reset_option ( '^display.' )
1159
+ self . reset_display_options ( )
1161
1160
df = DataFrame ({'x' : [3234 , 0.253 ]})
1162
1161
df_s = df .to_string (justify = 'left' )
1163
1162
expected = (' x \n '
@@ -1166,7 +1165,7 @@ def test_to_string_left_justify_cols(self):
1166
1165
assert (df_s == expected )
1167
1166
1168
1167
def test_to_string_format_na (self ):
1169
- fmt . reset_option ( '^display.' )
1168
+ self . reset_display_options ( )
1170
1169
df = DataFrame ({'A' : [np .nan , - 1 , - 2.1234 , 3 , 4 ],
1171
1170
'B' : [np .nan , 'foo' , 'foooo' , 'fooooo' , 'bar' ]})
1172
1171
result = df .to_string ()
@@ -1434,14 +1433,14 @@ def test_repr_html(self):
1434
1433
fmt .set_option ('display.notebook_repr_html' , False )
1435
1434
self .frame ._repr_html_ ()
1436
1435
1437
- fmt . reset_option ( '^display.' )
1436
+ self . reset_display_options ( )
1438
1437
1439
1438
df = DataFrame ([[1 , 2 ], [3 , 4 ]])
1440
1439
self .assertTrue ('2 rows' in df ._repr_html_ ())
1441
1440
fmt .set_option ('display.show_dimensions' , False )
1442
1441
self .assertFalse ('2 rows' in df ._repr_html_ ())
1443
1442
1444
- fmt . reset_option ( '^display.' )
1443
+ self . reset_display_options ( )
1445
1444
1446
1445
def test_repr_html_wide (self ):
1447
1446
row = lambda l , k : [tm .rands (k ) for _ in range (l )]
@@ -1580,7 +1579,7 @@ def get_ipython():
1580
1579
repstr = self .frame ._repr_html_ ()
1581
1580
self .assertIn ('class' , repstr ) # info fallback
1582
1581
1583
- fmt . reset_option ( '^display.' )
1582
+ self . reset_display_options ( )
1584
1583
1585
1584
def test_to_html_with_classes (self ):
1586
1585
df = pandas .DataFrame ()
@@ -2092,7 +2091,7 @@ def test_eng_float_formatter(self):
2092
2091
'3 1E+06' )
2093
2092
self .assertEqual (result , expected )
2094
2093
2095
- fmt . reset_option ( '^display.' )
2094
+ self . reset_display_options ( )
2096
2095
2097
2096
def compare (self , formatter , input , output ):
2098
2097
formatted_input = formatter (input )
0 commit comments