Include Pair name in exception log message

This commit is contained in:
Matthias 2019-12-31 07:11:09 +01:00
parent 9d518b9d29
commit 26a2395aeb
2 changed files with 3 additions and 3 deletions

View File

@ -485,7 +485,7 @@ class FreqtradeBot:
try:
trades_created += self.create_trade(pair)
except DependencyException as exception:
logger.warning('Unable to create trade: %s', exception)
logger.warning('Unable to create trade for %s: %s', pair, exception)
if not trades_created:
logger.debug("Found no buy signals for whitelisted currencies. "

View File

@ -1468,7 +1468,7 @@ def test_enter_positions_exception(mocker, default_conf, caplog) -> None:
n = freqtrade.enter_positions()
assert n == 0
assert mock_ct.call_count == len(default_conf['exchange']['pair_whitelist'])
assert log_has('Unable to create trade: ', caplog)
assert log_has('Unable to create trade for ETH/BTC: ', caplog)
def test_exit_positions(mocker, default_conf, limit_buy_order, caplog) -> None:
@ -3642,6 +3642,6 @@ def test_sync_wallet_dry_run(mocker, default_conf, ticker, fee, limit_buy_order,
bot.config['max_open_trades'] = 3
n = bot.enter_positions()
assert n == 0
assert log_has_re(r"Unable to create trade: "
assert log_has_re(r"Unable to create trade for XRP/BTC: "
r"Available balance \(0 BTC\) is lower than stake amount \(0.001 BTC\)",
caplog)