File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 26
26
option_context ,
27
27
read_csv ,
28
28
reset_option ,
29
- set_option ,
30
29
)
31
30
32
31
from pandas .io .formats import printing
@@ -382,15 +381,10 @@ def test_repr_float_formatting_html_output(
382
381
self , data , format_option , expected_values
383
382
):
384
383
if format_option is not None :
385
- set_option ("display.float_format" , format_option .format )
386
-
387
- df = DataFrame (data )
388
- html_output = df ._repr_html_ ()
389
- assert expected_values in html_output
390
-
391
- # reset option
392
- if format_option is not None :
393
- reset_option ("display.float_format" )
384
+ with option_context ("display.float_format" , format_option .format ):
385
+ df = DataFrame (data )
386
+ html_output = df ._repr_html_ ()
387
+ assert expected_values in html_output
394
388
395
389
def test_str_max_colwidth (self ):
396
390
# GH 7856
You can’t perform that action at this time.
0 commit comments