From 855b26f846fdda1eeb3314db2218a87835519eb1 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Mon, 11 Oct 2021 01:31:21 -0600 Subject: [PATCH] Parametrized more time machine tests in test_update_funding_fees --- freqtrade/freqtradebot.py | 2 +- tests/test_freqtradebot.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 50e5c1415..f2297833e 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -120,7 +120,7 @@ class FreqtradeBot(LoggingMixin): # TODO: funding interval, specified by funding_fee_times on the exchange classes for time_slot in range(0, 24): for minutes in [0, 15, 30, 45]: - t = str(time(time_slot, minutes)) + t = str(time(time_slot, minutes, 2)) schedule.every().day.at(t).do(update) def notify_status(self, msg: str) -> None: diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index a69414dfc..f7b0808b1 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -4,7 +4,6 @@ import logging import time from copy import deepcopy -# from datetime import tzinfo from math import isclose from unittest.mock import ANY, MagicMock, PropertyMock @@ -4285,8 +4284,12 @@ def test_get_valid_price(mocker, default_conf_usdt) -> None: @pytest.mark.parametrize('trading_mode,calls,t1,t2', [ (TradingMode.SPOT, 0, "2021-09-01 00:00:00", "2021-09-01 08:00:00"), (TradingMode.MARGIN, 0, "2021-09-01 00:00:00", "2021-09-01 08:00:00"), - (TradingMode.FUTURES, 32, "2021-09-01 00:00:01", "2021-09-01 08:00:00"), - (TradingMode.FUTURES, 33, "2021-08-31 23:59:59", "2021-09-01 08:00:01"), + (TradingMode.FUTURES, 31, "2021-09-01 00:00:02", "2021-09-01 08:00:01"), + # (TradingMode.FUTURES, 32, "2021-09-01 00:00:01", "2021-09-01 08:00:01"), + (TradingMode.FUTURES, 33, "2021-09-01 00:00:01", "2021-09-01 08:00:02"), + (TradingMode.FUTURES, 33, "2021-09-01 00:00:00", "2021-09-01 08:00:02"), + (TradingMode.FUTURES, 34, "2021-08-31 23:59:59", "2021-09-01 08:00:02"), + (TradingMode.FUTURES, 34, "2021-08-31 23:59:59", "2021-09-01 08:00:03"), ]) def test_update_funding_fees(mocker, default_conf, trading_mode, calls, time_machine, t1, t2):