Lines Matching refs:fut

152         fut = self.new_future(other_loop)
154 async def run(fut):
155 await fut
160 self.loop.run_until_complete(run(fut))
277 fut = asyncio.ensure_future(Aw(coro()), loop=loop)
278 loop.run_until_complete(fut)
279 self.assertEqual(fut.result(), 'ok')
403 async def wait_for(fut):
404 return await fut
406 fut = self.new_future(self.loop)
407 task = self.new_task(self.loop, wait_for(fut))
410 '<Task .* wait_for=%s>' % re.escape(repr(fut)))
412 fut.set_result(None)
755 fut = loop.create_future()
758 fut.set_result(None)
763 await fut
957 fut = self.new_future(loop)
960 await fut
980 self.assertTrue(fut.cancelled())
1502 [asyncio.ensure_future(fut) for fut in futs]
1521 fut = self.new_task(self.loop, runner())
1522 self.loop.run_until_complete(fut)
1523 result = fut.result()
1630 fut = self.new_future(self.loop)
1633 await fut
1637 self.assertIs(task._fut_waiter, fut)
1644 self.assertTrue(fut.cancelled())
1675 fut = Fut(loop=self.loop)
1680 result = await fut
1684 self.assertTrue(fut.cb_added)
1687 fut.set_result(res)
1755 fut = self.new_future(self.loop)
1758 return fut
1761 fut.set_result('test')
1766 self.assertEqual(res, fut)
1900 fut = self.new_future(self.loop)
1901 fut.set_result(42)
1902 res = self.loop.run_until_complete(asyncio.shield(fut))
1993 fut = self.new_future(self.loop)
1997 asyncio.as_completed(fut))
2004 fut = self.new_future(self.loop)
2008 asyncio.wait(fut))
2095 fut = self.new_future(loop)
2097 # The indirection fut->child_coro is needed since otherwise the
2100 return (yield from fut)
2109 fut.add_done_callback(cancelling_callback)
2111 fut.set_result(42) # calls the cancelling_callback after fut is done()
2291 def fut_on_done(fut):
2299 fut = self.new_future(loop)
2300 fut.add_done_callback(fut_on_done)
2302 loop.call_soon(fut.set_result, None)
2303 await fut
2466 fut = self.Future(loop=self.loop)
2469 self.loop.call_soon(lambda: fut.set_result('spam'))
2470 return await fut
2483 dict(fut.calls),
2653 await fut
2658 fut = Fut(loop=self.loop)
2659 self.loop.call_later(0.1, fut.set_result, 1)
2880 fut = self._gather(*self.wrap_futures(a, b, c), **kwargs)
2882 fut.add_done_callback(cb)
2887 self.assertFalse(fut.done())
2890 cb.assert_called_once_with(fut)
2891 self.assertEqual(fut.result(), [2, 1, 3])
2902 fut = self._gather(*self.wrap_futures(a, b, c, d, e))
2904 fut.add_done_callback(cb)
2909 self.assertTrue(fut.done())
2910 cb.assert_called_once_with(fut)
2911 self.assertIs(fut.exception(), exc)
2920 fut = self._gather(*self.wrap_futures(a, b, c, d),
2923 fut.add_done_callback(cb)
2930 self.assertFalse(fut.done())
2933 self.assertTrue(fut.done())
2934 cb.assert_called_once_with(fut)
2935 self.assertEqual(fut.result(), [3, 1, exc, exc2])
2983 fut = self.one_loop.run_until_complete(gather())
2984 self.assertIsInstance(fut, asyncio.Future)
2985 self.assertIs(fut._loop, self.one_loop)
2987 self.assertTrue(fut.done())
2988 self.assertEqual(fut.result(), [])
2994 fut = asyncio.gather()
2995 self.assertIsInstance(fut, asyncio.Future)
2996 self.assertIs(fut._loop, self.one_loop)
2998 self.assertTrue(fut.done())
2999 self.assertEqual(fut.result(), [])
3009 fut = asyncio.gather(*children)
3010 self.assertIs(fut._loop, self.other_loop)
3012 self.assertFalse(fut.done())
3013 fut = asyncio.gather(*children)
3014 self.assertIs(fut._loop, self.other_loop)
3016 self.assertFalse(fut.done())
3020 fut = asyncio.gather(a, b, c, d, e)
3022 fut.add_done_callback(cb)
3026 self.assertTrue(fut.done())
3027 cb.assert_called_once_with(fut)
3028 self.assertFalse(fut.cancelled())
3029 self.assertIsInstance(fut.exception(), asyncio.CancelledError)
3039 fut = asyncio.gather(a, b, c, d, e, f, return_exceptions=True)
3041 fut.add_done_callback(cb)
3047 self.assertFalse(fut.done())
3052 res = self.one_loop.run_until_complete(fut)
3057 cb.assert_called_once_with(fut)
3064 for fut in futures:
3065 async def coro(fut=fut):
3066 return await fut
3092 fut = self.one_loop.run_until_complete(gather())
3093 self.assertIs(fut._loop, self.one_loop)
3094 self.one_loop.run_until_complete(fut)
3104 fut = asyncio.gather(gen1, gen2)
3105 self.assertIs(fut._loop, self.other_loop)
3106 self.other_loop.run_until_complete(fut)
3112 fut = self._gather(c, c, coro('def'), c)
3114 self.assertEqual(fut.result(), ['abc', 'abc', 'def', 'abc'])