Skip to content

Commit 5101b17

Browse files
committed
test: slightly cleanup ws_ohlcv test
1 parent e90aa6a commit 5101b17

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tests/exchange/test_exchange_ws.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,8 @@ async def test_exchangews_ohlcv(mocker, time_machine, caplog):
6969
ccxt_object = MagicMock()
7070
caplog.set_level(logging.DEBUG)
7171

72-
# Create synchronization events for deterministic testing
73-
watch_call_event = asyncio.Event()
74-
watch_call_count = 0
75-
7672
async def controlled_sleeper(*args, **kwargs):
77-
"""Controlled async function that signals when called."""
78-
nonlocal watch_call_count
79-
watch_call_count += 1
80-
# Signal that a watch call happened
81-
watch_call_event.set()
73+
# Sleep to pass control back to the event loop
8274
await asyncio.sleep(0.1)
8375
return MagicMock()
8476

@@ -124,7 +116,7 @@ async def wait_for_condition(condition_func, timeout=5.0, check_interval=0.01):
124116
("XRP/BTC", "1m", CandleType.SPOT),
125117
}
126118

127-
# Wait for the expected number of watch calls (should be 6 based on original test logic)
119+
# Wait for the expected number of watch calls
128120
await wait_for_condition(lambda: ccxt_object.watch_ohlcv.call_count >= 6, timeout=3.0)
129121
assert ccxt_object.watch_ohlcv.call_count == 6
130122
ccxt_object.watch_ohlcv.reset_mock()

0 commit comments

Comments
 (0)