diff --git a/freqtrade/optimize/hyperopt_tools.py b/freqtrade/optimize/hyperopt_tools.py index ee3366a4e..f655582c4 100644 --- a/freqtrade/optimize/hyperopt_tools.py +++ b/freqtrade/optimize/hyperopt_tools.py @@ -362,8 +362,7 @@ class HyperoptTools(): ) trials['Avg duration'] = trials['Avg duration'].apply( lambda x: f'{x:,.1f} m' if isinstance( - x, float) else f"{x.total_seconds() // 60:,.1f} m" - if not isna(x) else "" + x, float) else f"{x.total_seconds() // 60:,.1f} m" if not isna(x) else "" ) trials['Objective'] = trials['Objective'].apply( lambda x: f'{x:,.5f}' if x != 100000 else "" diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index 60e6d2ea8..4d3937d87 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -918,7 +918,8 @@ def test_start_test_pairlist(mocker, caplog, tickers, default_conf, capsys): captured.out) -def test_hyperopt_list(mocker, capsys, caplog, saved_hyperopt_results, saved_hyperopt_results_legacy): +def test_hyperopt_list(mocker, capsys, caplog, saved_hyperopt_results, + saved_hyperopt_results_legacy): for _ in (saved_hyperopt_results, saved_hyperopt_results_legacy): mocker.patch( 'freqtrade.optimize.hyperopt_tools.HyperoptTools.load_previous_results',