From 110b50a3cb04e92ccf0727a1d3cf869c51c3063d Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 2 Feb 2026 20:30:02 +0100 Subject: [PATCH] test: improve test_exchangews_ohlcv test setup --- tests/exchange/test_exchange_ws.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/exchange/test_exchange_ws.py b/tests/exchange/test_exchange_ws.py index ed96e66d0..06595e71c 100644 --- a/tests/exchange/test_exchange_ws.py +++ b/tests/exchange/test_exchange_ws.py @@ -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