(self)
| 188 | self.loop.run_until_complete(runner()) |
| 189 | |
| 190 | def test_double_await(self): |
| 191 | async def afunc(): |
| 192 | await asyncio.sleep(0.1) |
| 193 | |
| 194 | async def runner(): |
| 195 | coro = afunc() |
| 196 | t = self.loop.create_task(coro) |
| 197 | try: |
| 198 | await asyncio.sleep(0) |
| 199 | await coro |
| 200 | finally: |
| 201 | t.cancel() |
| 202 | |
| 203 | self.loop.set_debug(True) |
| 204 | with self.assertRaises( |
| 205 | RuntimeError, |
| 206 | msg='coroutine is being awaited already'): |
| 207 | |
| 208 | self.loop.run_until_complete(runner()) |
| 209 | |
| 210 | |
| 211 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected