From 26a2395aebd0b1ed39aaadb63e674dcf64a592bc Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 31 Dec 2019 07:11:09 +0100 Subject: [PATCH] Include Pair name in exception log message --- freqtrade/freqtradebot.py | 2 +- tests/test_freqtradebot.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index c595150ac..a642e6ea7 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -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. " diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 6527554be..cf395ef39 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -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)