MCPcopy
hub / github.com/aio-libs/aiohttp / test_exception_waiter

Method test_exception_waiter

tests/test_streams.py:697–707  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

695 self.assertIs(self.buffer.exception(), exc)
696
697 def test_exception_waiter(self):
698 @asyncio.coroutine
699 def set_err():
700 self.buffer.set_exception(ValueError())
701
702 t1 = asyncio.Task(self.buffer.read(), loop=self.loop)
703 t2 = asyncio.Task(set_err(), loop=self.loop)
704
705 self.loop.run_until_complete(asyncio.wait([t1, t2], loop=self.loop))
706
707 self.assertRaises(ValueError, t1.result)
708
709
710class TestDataQueue(unittest.TestCase, DataQueueMixin):

Callers

nothing calls this directly

Calls 2

waitMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected