(self)
| 286 | self.assertFalse(f.cancel()) |
| 287 | |
| 288 | def test_exception(self): |
| 289 | exc = RuntimeError() |
| 290 | f = self._new_future(loop=self.loop) |
| 291 | self.assertRaises(asyncio.InvalidStateError, f.exception) |
| 292 | |
| 293 | f.set_exception(exc) |
| 294 | self.assertFalse(f.cancelled()) |
| 295 | self.assertTrue(f.done()) |
| 296 | self.assertRaises(RuntimeError, f.result) |
| 297 | self.assertEqual(f.exception(), exc) |
| 298 | self.assertRaises(asyncio.InvalidStateError, f.set_result, None) |
| 299 | self.assertRaises(asyncio.InvalidStateError, f.set_exception, None) |
| 300 | self.assertFalse(f.cancel()) |
| 301 | |
| 302 | def test_stop_iteration_exception(self, stop_iteration_class=StopIteration): |
| 303 | exc = stop_iteration_class() |
nothing calls this directly
no test coverage detected