From 612a09634c30681d1478c95ba8cd6c6db431e36b Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 13 Aug 2025 13:08:58 +0200 Subject: [PATCH] test: use appropriate error handlers --- tests/test_configuration.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_configuration.py b/tests/test_configuration.py index eb5e67823..8e5c29ae1 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -51,20 +51,20 @@ def test_load_config_missing_attributes(default_conf) -> None: conf = deepcopy(default_conf) conf.pop("exchange") - with pytest.raises(ValidationError, match=r".*'exchange' is a required property.*"): + with pytest.raises(ConfigurationError, match=r".*'exchange' is a required property.*"): validate_config_schema(conf) conf = deepcopy(default_conf) conf.pop("stake_currency") conf["runmode"] = RunMode.DRY_RUN - with pytest.raises(ValidationError, match=r".*'stake_currency' is a required property.*"): + with pytest.raises(ConfigurationError, match=r".*'stake_currency' is a required property.*"): validate_config_schema(conf) def test_load_config_incorrect_stake_amount(default_conf) -> None: default_conf["stake_amount"] = "fake" - with pytest.raises(ValidationError, match=r".*'fake' does not match 'unlimited'.*"): + with pytest.raises(ConfigurationError, match=r".*'fake' does not match 'unlimited'.*"): validate_config_schema(default_conf) @@ -1075,7 +1075,7 @@ def test_load_config_default_exchange(all_conf) -> None: assert "exchange" not in all_conf - with pytest.raises(ValidationError, match=r"'exchange' is a required property"): + with pytest.raises(ConfigurationError, match=r"'exchange' is a required property"): validate_config_schema(all_conf) @@ -1088,14 +1088,14 @@ def test_load_config_default_exchange_name(all_conf) -> None: assert "name" not in all_conf["exchange"] - with pytest.raises(ValidationError, match=r"'name' is a required property"): + with pytest.raises(ConfigurationError, match=r"'name' is a required property"): validate_config_schema(all_conf) def test_load_config_stoploss_exchange_limit_ratio(all_conf) -> None: all_conf["order_types"]["stoploss_on_exchange_limit_ratio"] = 1.15 - with pytest.raises(ValidationError, match=r"1.15 is greater than the maximum"): + with pytest.raises(ConfigurationError, match=r"1.15 is greater than the maximum"): validate_config_schema(all_conf)