test: improve test_exchangews_ohlcv test setup

This commit is contained in:
Matthias
2026-02-02 20:30:02 +01:00
parent 36f5afe910
commit 110b50a3cb

View File

@@ -85,7 +85,7 @@ async def test_exchangews_ohlcv(mocker, time_machine, caplog):
except TimeoutError:
return False
ccxt_object.un_watch_ohlcv_for_symbols = AsyncMock(side_effect=NotSupported)
ccxt_object.un_watch_ohlcv_for_symbols = AsyncMock(side_effect=[NotSupported, ValueError])
ccxt_object.watch_ohlcv = AsyncMock(side_effect=controlled_sleeper)
ccxt_object.close = AsyncMock()
time_machine.move_to("2024-11-01 01:00:02 +00:00")
@@ -138,7 +138,7 @@ async def test_exchangews_ohlcv(mocker, time_machine, caplog):
}
# Cleanup happened.
ccxt_object.un_watch_ohlcv_for_symbols = AsyncMock(side_effect=ValueError)
# Triggers 2nd call to un_watch_ohlcv_for_symbols which raises ValueError
exchange_ws.schedule_ohlcv("ETH/BTC", "1m", CandleType.SPOT)
# Verify final state