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 2626 option_context ,
2727 read_csv ,
2828 reset_option ,
29- set_option ,
3029)
3130
3231from pandas .io .formats import printing
@@ -382,15 +381,10 @@ def test_repr_float_formatting_html_output(
382381 self , data , format_option , expected_values
383382 ):
384383 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
394388
395389 def test_str_max_colwidth (self ):
396390 # GH 7856
You can’t perform that action at this time.
0 commit comments