MCPcopy Index your code
hub / github.com/python/cpython / test_wrap_future

Method test_wrap_future

Lib/test/test_asyncio/test_futures.py:579–590  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

577 self.assertFalse(m_log.error.called)
578
579 def test_wrap_future(self):
580
581 def run(arg):
582 return (arg, threading.get_ident())
583 ex = concurrent.futures.ThreadPoolExecutor(1)
584 f1 = ex.submit(run, 'oi')
585 f2 = asyncio.wrap_future(f1, loop=self.loop)
586 res, ident = self.loop.run_until_complete(f2)
587 self.assertTrue(asyncio.isfuture(f2))
588 self.assertEqual(res, 'oi')
589 self.assertNotEqual(ident, threading.get_ident())
590 ex.shutdown(wait=True)
591
592 def test_wrap_future_future(self):
593 f1 = self._new_future(loop=self.loop)

Callers

nothing calls this directly

Calls 6

submitMethod · 0.95
shutdownMethod · 0.95
assertTrueMethod · 0.80
assertNotEqualMethod · 0.80
run_until_completeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected