MCPcopy Create free account
hub / github.com/ccxt/ccxt / test_closed_by_user

Function test_closed_by_user

python/ccxt/pro/test/base/test_future.py:164–179  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162 assert result == "immediate success", "Race did not correctly prioritize already completed future."
163
164async def test_closed_by_user():
165 print("test_closed_by_user")
166 future1 = Future()
167 future2 = Future()
168 race_future = Future.race([future1, future2])
169 task1 = asyncio.create_task(reject_later(future1, ExchangeClosedByUser(), 0.1))
170 task2 = asyncio.create_task(reject_later(future2, ExchangeClosedByUser(), 0.1))
171 try:
172 await race_future
173 assert False, "Expected an ExchangeClosedByUser"
174 except ExchangeClosedByUser:
175 assert True
176 assert task1.done()
177 assert task2.done()
178 except Exception as e:
179 assert False, f"Received Exception {e}"
180
181async def test_ws_future():
182 await test_resolve_before()

Callers 1

test_ws_futureFunction · 0.85

Calls 4

FutureClass · 0.90
reject_laterFunction · 0.85
raceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…