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

Method test_exception_cancel

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

Source from the content-addressed store, hash-verified

605 self.assertRaises(ValueError, t1.result)
606
607 def test_exception_cancel(self):
608 stream = asyncio.StreamReader(loop=self.loop)
609
610 t = self.loop.create_task(stream.readline())
611 test_utils.run_briefly(self.loop)
612 t.cancel()
613 test_utils.run_briefly(self.loop)
614 # The following line fails if set_exception() isn't careful.
615 stream.set_exception(RuntimeError('message'))
616 test_utils.run_briefly(self.loop)
617 self.assertIs(stream._waiter, None)
618
619 def test_start_server(self):
620

Callers

nothing calls this directly

Calls 6

readlineMethod · 0.95
set_exceptionMethod · 0.95
run_brieflyMethod · 0.80
create_taskMethod · 0.45
cancelMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected