From e0d5242a45adcdba7d44b8b629471c5740bac624 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 17 Jun 2023 14:55:23 +0200 Subject: [PATCH] Reduce download-data verbosity --- freqtrade/data/history/history_utils.py | 2 +- tests/data/test_history.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/freqtrade/data/history/history_utils.py b/freqtrade/data/history/history_utils.py index 2833a6d50..7881130e2 100644 --- a/freqtrade/data/history/history_utils.py +++ b/freqtrade/data/history/history_utils.py @@ -294,7 +294,7 @@ def refresh_backtest_ohlcv_data(exchange: Exchange, pairs: List[str], timeframes continue for timeframe in timeframes: - logger.info(f'Downloading pair {pair}, interval {timeframe}.') + logger.debug(f'Downloading pair {pair}, {candle_type}, interval {timeframe}.') process = f'{idx}/{len(pairs)}' _download_pair_history(pair=pair, process=process, datadir=datadir, exchange=exchange, diff --git a/tests/data/test_history.py b/tests/data/test_history.py index e397c97c1..ab2238b08 100644 --- a/tests/data/test_history.py +++ b/tests/data/test_history.py @@ -1,6 +1,7 @@ # pragma pylint: disable=missing-docstring, protected-access, C0103 import json +import logging import uuid from pathlib import Path from shutil import copyfile @@ -503,9 +504,10 @@ def test_validate_backtest_data(default_conf, mocker, caplog, testdatadir) -> No ]) def test_refresh_backtest_ohlcv_data( mocker, default_conf, markets, caplog, testdatadir, trademode, callcount): - dl_mock = mocker.patch('freqtrade.data.history.history_utils._download_pair_history', - MagicMock()) + caplog.set_level(logging.DEBUG) + dl_mock = mocker.patch('freqtrade.data.history.history_utils._download_pair_history') mocker.patch(f'{EXMS}.markets', PropertyMock(return_value=markets)) + mocker.patch.object(Path, "exists", MagicMock(return_value=True)) mocker.patch.object(Path, "unlink", MagicMock()) @@ -520,7 +522,7 @@ def test_refresh_backtest_ohlcv_data( assert dl_mock.call_count == callcount assert dl_mock.call_args[1]['timerange'].starttype == 'date' - assert log_has("Downloading pair ETH/BTC, interval 1m.", caplog) + assert log_has_re(r"Downloading pair ETH/BTC, .* interval 1m\.", caplog) def test_download_data_no_markets(mocker, default_conf, caplog, testdatadir):