2222)
2323from freqtrade .strategy .strategy_validation import StrategyResultValidator
2424from freqtrade .util import dt_now
25+ from freqtrade .util .datetime_helpers import dt_now_no_micro
2526from tests .conftest import CURRENT_TEST_STRATEGY , TRADE_SIDES , log_has , log_has_re
2627
2728from .strats .strategy_test_v3 import StrategyTestV3
3334
3435
3536def test_returns_latest_signal (ohlcv_history ):
36- ohlcv_history .loc [1 , "date" ] = dt_now ()
37+ ohlcv_history .loc [1 , "date" ] = dt_now_no_micro ()
3738 # Take a copy to correctly modify the call
3839 mocked_history = ohlcv_history .copy ()
3940 mocked_history ["enter_long" ] = 0
@@ -160,7 +161,7 @@ def test_get_signal_exception_valueerror(mocker, caplog, ohlcv_history):
160161def test_get_signal_old_dataframe (default_conf , mocker , caplog , ohlcv_history ):
161162 # default_conf defines a 5m interval. we check interval * 2 + 5m
162163 # this is necessary as the last candle is removed (partial candles) by default
163- ohlcv_history .loc [1 , "date" ] = dt_now () - timedelta (minutes = 16 )
164+ ohlcv_history .loc [1 , "date" ] = dt_now_no_micro () - timedelta (minutes = 16 )
164165 # Take a copy to correctly modify the call
165166 mocked_history = ohlcv_history .copy ()
166167 mocked_history ["exit_long" ] = 0
@@ -179,7 +180,7 @@ def test_get_signal_old_dataframe(default_conf, mocker, caplog, ohlcv_history):
179180def test_get_signal_no_sell_column (default_conf , mocker , caplog , ohlcv_history ):
180181 # default_conf defines a 5m interval. we check interval * 2 + 5m
181182 # this is necessary as the last candle is removed (partial candles) by default
182- ohlcv_history .loc [1 , "date" ] = dt_now ()
183+ ohlcv_history .loc [1 , "date" ] = dt_now_no_micro ()
183184 # Take a copy to correctly modify the call
184185 mocked_history = ohlcv_history .copy ()
185186 # Intentionally don't set sell column
@@ -223,7 +224,7 @@ def test_ignore_expired_candle(default_conf):
223224
224225
225226def test_assert_df_raise (mocker , caplog , ohlcv_history ):
226- ohlcv_history .loc [1 , "date" ] = dt_now () - timedelta (minutes = 16 )
227+ ohlcv_history .loc [1 , "date" ] = dt_now_no_micro () - timedelta (minutes = 16 )
227228 # Take a copy to correctly modify the call
228229 mocked_history = ohlcv_history .copy ()
229230 mocked_history ["sell" ] = 0
0 commit comments