Don't check exchange for Utils commands

This commit is contained in:
Matthias 2019-11-03 10:18:46 +01:00
parent 500d16620b
commit 3eca80217c
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ def check_exchange(config: Dict[str, Any], check_for_bad: bool = True) -> bool:
and thus is not known for the Freqtrade at all. and thus is not known for the Freqtrade at all.
""" """
if (config['runmode'] in [RunMode.PLOT, RunMode.UTIL_NO_EXCHANGE] if (config['runmode'] in [RunMode.PLOT, RunMode.UTIL_NO_EXCHANGE, RunMode.OTHER]
and not config.get('exchange', {}).get('name')): and not config.get('exchange', {}).get('name')):
# Skip checking exchange in plot mode, since it requires no exchange # Skip checking exchange in plot mode, since it requires no exchange
return True return True

View File

@ -545,7 +545,7 @@ def test_check_exchange(default_conf, caplog) -> None:
# Test no exchange... # Test no exchange...
default_conf.get('exchange').update({'name': ''}) default_conf.get('exchange').update({'name': ''})
default_conf['runmode'] = RunMode.OTHER default_conf['runmode'] = RunMode.UTIL_EXCHANGE
with pytest.raises(OperationalException, with pytest.raises(OperationalException,
match=r'This command requires a configured exchange.*'): match=r'This command requires a configured exchange.*'):
check_exchange(default_conf) check_exchange(default_conf)