diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index fc7fa31e1..96a9dbe57 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -906,7 +906,8 @@ def test_simplified_interface_all_failed(mocker, hyperopt_conf, caplog) -> None: hyperopt.hyperopter.backtesting.strategy.advise_all_indicators = MagicMock() hyperopt.hyperopter.custom_hyperopt.generate_roi_table = MagicMock(return_value={}) - with pytest.raises(OperationalException, match=r"The 'protection' space is included into *"): + # The first one to fail raises the exception + with pytest.raises(OperationalException, match=r"The 'buy' space is included into *"): hyperopt.hyperopter.init_spaces() hyperopt.config["hyperopt_ignore_missing_space"] = True