MCPcopy Create free account
hub / github.com/dchevell/flask-executor / test_future_proxy

Function test_future_proxy

tests/test_futures.py:57–68  ·  view source on GitHub ↗
(default_app)

Source from the content-addressed store, hash-verified

55 assert future not in futures
56
57def test_future_proxy(default_app):
58 executor = Executor(default_app)
59 with default_app.test_request_context(''):
60 future = executor.submit(pow, 2, 4)
61 # Test if we're returning a subclass of Future
62 assert isinstance(future, concurrent.futures.Future)
63 assert isinstance(future, FutureProxy)
64 concurrent.futures.wait([future])
65 # test standard Future methods and attributes
66 assert future._state == concurrent.futures._base.FINISHED
67 assert future.done()
68 assert future.exception(timeout=0) is None
69
70def test_add_done_callback(default_app):
71 """Exceptions thrown in callbacks can't be easily caught and make it hard

Callers

nothing calls this directly

Calls 2

submitMethod · 0.95
ExecutorClass · 0.90

Tested by

no test coverage detected