Skip to content

Commit 81fdff1

Browse files
committed
chore: simplify exchangews_ohlcv further
1 parent 5101b17 commit 81fdff1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/exchange/test_exchange_ws.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,22 @@ async def wait_for_condition(condition_func, timeout=5.0, check_interval=0.01):
118118

119119
# Wait for the expected number of watch calls
120120
await wait_for_condition(lambda: ccxt_object.watch_ohlcv.call_count >= 6, timeout=3.0)
121-
assert ccxt_object.watch_ohlcv.call_count == 6
121+
assert ccxt_object.watch_ohlcv.call_count >= 6
122122
ccxt_object.watch_ohlcv.reset_mock()
123123

124124
time_machine.shift(timedelta(minutes=5))
125125
exchange_ws.schedule_ohlcv("ETH/BTC", "1m", CandleType.SPOT)
126126

127-
# Wait for log message and state changes with timeout
127+
# Wait for log message
128128
await wait_for_condition(
129129
lambda: log_has_re("un_watch_ohlcv_for_symbols not supported: ", caplog), timeout=2.0
130130
)
131+
assert log_has_re("un_watch_ohlcv_for_symbols not supported: ", caplog)
131132

132-
# Wait for XRP/BTC cleanup
133-
await wait_for_condition(
134-
lambda: exchange_ws._klines_watching == {("ETH/BTC", "1m", CandleType.SPOT)},
135-
timeout=2.0,
136-
)
133+
# XRP/BTC should be cleaned up.
134+
assert exchange_ws._klines_watching == {
135+
("ETH/BTC", "1m", CandleType.SPOT),
136+
}
137137

138138
# Cleanup happened.
139139
ccxt_object.un_watch_ohlcv_for_symbols = AsyncMock(side_effect=ValueError)

0 commit comments

Comments
 (0)