Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/exchange/test_exchange_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ async def wait_for_condition(condition_func, timeout_=5.0, check_interval=0.01):
}

# Cleanup happened.
# Triggers 2nd call to un_watch_ohlcv_for_symbols which raises ValueError
exchange_ws.schedule_ohlcv("ETH/BTC", "1m", CandleType.SPOT)

# Verify final state
Expand All @@ -149,10 +148,16 @@ async def wait_for_condition(condition_func, timeout_=5.0, check_interval=0.01):
("ETH/BTC", "1m", CandleType.SPOT),
}

# Triggers 2nd call to un_watch_ohlcv_for_symbols which raises ValueError
exchange_ws._klines_watching.discard(("ETH/BTC", "1m", CandleType.SPOT))
await wait_for_condition(
lambda: log_has_re("Exception in _unwatch_ohlcv", caplog), timeout_=2.0
)
assert log_has_re("Exception in _unwatch_ohlcv", caplog)

finally:
# Cleanup
exchange_ws.cleanup()
assert log_has_re("Exception in _unwatch_ohlcv", caplog)


async def test_exchangews_get_ohlcv(mocker, caplog):
Expand Down
Loading