mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-03-01 15:52:43 +00:00
tests: fix random test failure by reading time only once
This commit is contained in:
@@ -2090,13 +2090,14 @@ def test_get_historic_ohlcv(default_conf, mocker, caplog, exchange_name, candle_
|
|||||||
exchange = get_patched_exchange(mocker, default_conf, exchange=exchange_name)
|
exchange = get_patched_exchange(mocker, default_conf, exchange=exchange_name)
|
||||||
pair = "ETH/BTC"
|
pair = "ETH/BTC"
|
||||||
calls = 0
|
calls = 0
|
||||||
|
now = dt_now()
|
||||||
|
|
||||||
async def mock_candle_hist(pair, timeframe, candle_type, since_ms):
|
async def mock_candle_hist(pair, timeframe, candle_type, since_ms):
|
||||||
nonlocal calls
|
nonlocal calls
|
||||||
calls += 1
|
calls += 1
|
||||||
ohlcv = [
|
ohlcv = [
|
||||||
[
|
[
|
||||||
dt_ts(dt_now() + timedelta(minutes=5 * (calls + i))), # unix timestamp ms
|
dt_ts(now + timedelta(minutes=5 * (calls + i))), # unix timestamp ms
|
||||||
1, # open
|
1, # open
|
||||||
2, # high
|
2, # high
|
||||||
3, # low
|
3, # low
|
||||||
|
|||||||
Reference in New Issue
Block a user