From 0c10719037137778f3b81e7d90fe0ca5aa1058ba Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 6 Dec 2018 06:57:07 +0100 Subject: [PATCH] Specify JsonValidatorversion explicitly without doing that, it exclusiveMaximum raises an exception as jsonschema defaults to the latest version (Draft6) which changes behaviour of this property. fixes #1233 --- freqtrade/configuration.py | 2 +- freqtrade/tests/test_configuration.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/freqtrade/configuration.py b/freqtrade/configuration.py index feec0cb43..e9daf4a99 100644 --- a/freqtrade/configuration.py +++ b/freqtrade/configuration.py @@ -275,7 +275,7 @@ class Configuration(object): :return: Returns the config if valid, otherwise throw an exception """ try: - validate(conf, constants.CONF_SCHEMA) + validate(conf, constants.CONF_SCHEMA, Draft4Validator) return conf except ValidationError as exception: logger.critical( diff --git a/freqtrade/tests/test_configuration.py b/freqtrade/tests/test_configuration.py index 23fefd3cd..5a0ae2636 100644 --- a/freqtrade/tests/test_configuration.py +++ b/freqtrade/tests/test_configuration.py @@ -6,7 +6,7 @@ import logging from unittest.mock import MagicMock import pytest -from jsonschema import validate, ValidationError +from jsonschema import validate, ValidationError, Draft4Validator from freqtrade import constants from freqtrade import OperationalException @@ -486,4 +486,4 @@ def test_load_config_warn_forcebuy(default_conf, mocker, caplog) -> None: def test_validate_default_conf(default_conf) -> None: - validate(default_conf, constants.CONF_SCHEMA) + validate(default_conf, constants.CONF_SCHEMA, Draft4Validator)