Skip to content

Commit 110b50a

Browse files
committed
test: improve test_exchangews_ohlcv test setup
1 parent 36f5afe commit 110b50a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/exchange/test_exchange_ws.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async def wait_for_condition(condition_func, timeout_=5.0, check_interval=0.01):
8585
except TimeoutError:
8686
return False
8787

88-
ccxt_object.un_watch_ohlcv_for_symbols = AsyncMock(side_effect=NotSupported)
88+
ccxt_object.un_watch_ohlcv_for_symbols = AsyncMock(side_effect=[NotSupported, ValueError])
8989
ccxt_object.watch_ohlcv = AsyncMock(side_effect=controlled_sleeper)
9090
ccxt_object.close = AsyncMock()
9191
time_machine.move_to("2024-11-01 01:00:02 +00:00")
@@ -138,7 +138,7 @@ async def wait_for_condition(condition_func, timeout_=5.0, check_interval=0.01):
138138
}
139139

140140
# Cleanup happened.
141-
ccxt_object.un_watch_ohlcv_for_symbols = AsyncMock(side_effect=ValueError)
141+
# Triggers 2nd call to un_watch_ohlcv_for_symbols which raises ValueError
142142
exchange_ws.schedule_ohlcv("ETH/BTC", "1m", CandleType.SPOT)
143143

144144
# Verify final state

0 commit comments

Comments
 (0)