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

Method test_exception_waiter

Lib/test/test_asyncio/test_streams.py:594–605  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

592 self.assertIs(stream.exception(), exc)
593
594 def test_exception_waiter(self):
595 stream = asyncio.StreamReader(loop=self.loop)
596
597 async def set_err():
598 stream.set_exception(ValueError())
599
600 t1 = self.loop.create_task(stream.readline())
601 t2 = self.loop.create_task(set_err())
602
603 self.loop.run_until_complete(asyncio.wait([t1, t2]))
604
605 self.assertRaises(ValueError, t1.result)
606
607 def test_exception_cancel(self):
608 stream = asyncio.StreamReader(loop=self.loop)

Callers

nothing calls this directly

Calls 5

readlineMethod · 0.95
create_taskMethod · 0.45
run_until_completeMethod · 0.45
waitMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected