Fix hypeopt issue when no result found

This commit is contained in:
Gerald Lonlas
2018-01-07 17:45:31 -08:00
parent fca6a09a41
commit 9c21077dc1
2 changed files with 39 additions and 7 deletions

View File

@@ -114,3 +114,22 @@ def test_fmin_best_results(mocker, caplog):
for line in exists:
assert line in caplog.text
def test_fmin_throw_value_error(mocker, caplog):
mocker.patch('freqtrade.optimize.hyperopt.MongoTrials', return_value=create_trials(mocker))
mocker.patch('freqtrade.optimize.preprocess')
mocker.patch('freqtrade.optimize.load_data')
mocker.patch('freqtrade.optimize.hyperopt.fmin', side_effect=ValueError())
args = mocker.Mock(epochs=1, config='config.json.example')
start(args)
exists = [
'Best Result:',
'Sorry, Hyperopt was not able to find good parameters. Please try with more epochs '
'(param: -e).',
]
for line in exists:
assert line in caplog.text