def set_err():
stream.set_exception(ValueError())
- @asyncio.coroutine
- def readline():
- yield from stream.readline()
-
t1 = asyncio.Task(stream.readline(), loop=self.loop)
t2 = asyncio.Task(set_err(), loop=self.loop)
def test_exception_cancel(self):
stream = asyncio.StreamReader(loop=self.loop)
- @asyncio.coroutine
- def read_a_line():
- yield from stream.readline()
-
- t = asyncio.Task(read_a_line(), loop=self.loop)
+ t = asyncio.Task(stream.readline(), loop=self.loop)
test_utils.run_briefly(self.loop)
t.cancel()
test_utils.run_briefly(self.loop)