Fix test failure (double-trailing newlines are removed now)

This commit is contained in:
Matthias 2019-06-08 19:32:31 +02:00
parent 7134273918
commit 5273540a93

View File

@ -372,20 +372,21 @@ def test_start_calls_optimizer(mocker, default_conf, caplog) -> None:
) )
patch_exchange(mocker) patch_exchange(mocker)
default_conf.update({'config': 'config.json.example'}) default_conf.update({'config': 'config.json.example',
default_conf.update({'epochs': 1}) 'epochs': 1,
default_conf.update({'timerange': None}) 'timerange': None,
default_conf.update({'spaces': 'all'}) 'spaces': 'all',
default_conf.update({'hyperopt_jobs': 1}) 'hyperopt_jobs': 1, })
hyperopt = Hyperopt(default_conf) hyperopt = Hyperopt(default_conf)
hyperopt.strategy.tickerdata_to_dataframe = MagicMock() hyperopt.strategy.tickerdata_to_dataframe = MagicMock()
hyperopt.start() hyperopt.start()
parallel.assert_called_once() parallel.assert_called_once()
assert log_has('Best result:\nfoo result\nwith values:\n', caplog.record_tuples)
assert 'Best result:\nfoo result\nwith values:\n\n' in caplog.text
assert dumper.called assert dumper.called
# Should be called twice, once for tickerdata, once to save evaluations
assert dumper.call_count == 2
def test_format_results(hyperopt): def test_format_results(hyperopt):