Skip to content

Commit 612a096

Browse files
committed
test: use appropriate error handlers
1 parent fd6a245 commit 612a096

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_configuration.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ def test_load_config_missing_attributes(default_conf) -> None:
5151
conf = deepcopy(default_conf)
5252
conf.pop("exchange")
5353

54-
with pytest.raises(ValidationError, match=r".*'exchange' is a required property.*"):
54+
with pytest.raises(ConfigurationError, match=r".*'exchange' is a required property.*"):
5555
validate_config_schema(conf)
5656

5757
conf = deepcopy(default_conf)
5858
conf.pop("stake_currency")
5959
conf["runmode"] = RunMode.DRY_RUN
60-
with pytest.raises(ValidationError, match=r".*'stake_currency' is a required property.*"):
60+
with pytest.raises(ConfigurationError, match=r".*'stake_currency' is a required property.*"):
6161
validate_config_schema(conf)
6262

6363

6464
def test_load_config_incorrect_stake_amount(default_conf) -> None:
6565
default_conf["stake_amount"] = "fake"
6666

67-
with pytest.raises(ValidationError, match=r".*'fake' does not match 'unlimited'.*"):
67+
with pytest.raises(ConfigurationError, match=r".*'fake' does not match 'unlimited'.*"):
6868
validate_config_schema(default_conf)
6969

7070

@@ -1075,7 +1075,7 @@ def test_load_config_default_exchange(all_conf) -> None:
10751075

10761076
assert "exchange" not in all_conf
10771077

1078-
with pytest.raises(ValidationError, match=r"'exchange' is a required property"):
1078+
with pytest.raises(ConfigurationError, match=r"'exchange' is a required property"):
10791079
validate_config_schema(all_conf)
10801080

10811081

@@ -1088,14 +1088,14 @@ def test_load_config_default_exchange_name(all_conf) -> None:
10881088

10891089
assert "name" not in all_conf["exchange"]
10901090

1091-
with pytest.raises(ValidationError, match=r"'name' is a required property"):
1091+
with pytest.raises(ConfigurationError, match=r"'name' is a required property"):
10921092
validate_config_schema(all_conf)
10931093

10941094

10951095
def test_load_config_stoploss_exchange_limit_ratio(all_conf) -> None:
10961096
all_conf["order_types"]["stoploss_on_exchange_limit_ratio"] = 1.15
10971097

1098-
with pytest.raises(ValidationError, match=r"1.15 is greater than the maximum"):
1098+
with pytest.raises(ConfigurationError, match=r"1.15 is greater than the maximum"):
10991099
validate_config_schema(all_conf)
11001100

11011101

0 commit comments

Comments
 (0)