From 38e48c0c5ee875f100056b7e48a4eb40403d2aab Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 8 Dec 2025 11:55:26 +0100 Subject: [PATCH] test: update refresh ohlcv data test --- tests/data/test_history.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/data/test_history.py b/tests/data/test_history.py index 32dc33f07..e09572ad8 100644 --- a/tests/data/test_history.py +++ b/tests/data/test_history.py @@ -534,15 +534,15 @@ def test_validate_backtest_data(default_conf, mocker, caplog, testdatadir) -> No @pytest.mark.parametrize( - "trademode,callcount", + "trademode,callcount, callcount_parallel", [ - ("spot", 4), - ("margin", 4), - ("futures", 8), # Called 8 times - 4 normal, 2 funding and 2 mark/index calls + ("spot", 4, 2), + ("margin", 4, 2), + ("futures", 8, 2), # Called 8 times - 4 normal, 2 funding and 2 mark/index calls ], ) def test_refresh_backtest_ohlcv_data( - mocker, default_conf, markets, caplog, testdatadir, trademode, callcount + mocker, default_conf, markets, caplog, testdatadir, trademode, callcount, callcount_parallel ): caplog.set_level(logging.DEBUG) dl_mock = mocker.patch("freqtrade.data.history.history_utils._download_pair_history") @@ -573,7 +573,8 @@ def test_refresh_backtest_ohlcv_data( ) # Called once per timeframe (as we return an empty dataframe) - assert parallel_mock.call_count == 2 + # called twice for spot/margin and 4 times for futures + assert parallel_mock.call_count == callcount_parallel assert dl_mock.call_count == callcount assert dl_mock.call_args[1]["timerange"].starttype == "date"