| 55 | assert future not in futures |
| 56 | |
| 57 | def 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 | |
| 70 | def test_add_done_callback(default_app): |
| 71 | """Exceptions thrown in callbacks can't be easily caught and make it hard |