(self)
| 852 | (asyncio.CancelledError, ('my message',), 0)) |
| 853 | |
| 854 | def test_cancel_yield(self): |
| 855 | async def task(): |
| 856 | await asyncio.sleep(0) |
| 857 | await asyncio.sleep(0) |
| 858 | return 12 |
| 859 | |
| 860 | t = self.new_task(self.loop, task()) |
| 861 | test_utils.run_briefly(self.loop) # start coro |
| 862 | t.cancel() |
| 863 | self.assertRaises( |
| 864 | asyncio.CancelledError, self.loop.run_until_complete, t) |
| 865 | self.assertTrue(t.done()) |
| 866 | self.assertTrue(t.cancelled()) |
| 867 | self.assertFalse(t.cancel()) |
| 868 | |
| 869 | def test_cancel_inner_future(self): |
| 870 | f = self.new_future(self.loop) |
nothing calls this directly
no test coverage detected