(self)
| 300 | self.assertIs(runner.get_loop(), loop) |
| 301 | |
| 302 | def test_run(self): |
| 303 | async def f(): |
| 304 | await asyncio.sleep(0) |
| 305 | return 'done' |
| 306 | |
| 307 | with asyncio.Runner() as runner: |
| 308 | self.assertEqual('done', runner.run(f())) |
| 309 | loop = runner.get_loop() |
| 310 | |
| 311 | with self.assertRaisesRegex( |
| 312 | RuntimeError, |
| 313 | "Runner is closed" |
| 314 | ): |
| 315 | runner.get_loop() |
| 316 | |
| 317 | self.assertTrue(loop.is_closed()) |
| 318 | |
| 319 | def test_run_non_coro(self): |
| 320 | with asyncio.Runner() as runner: |
nothing calls this directly
no test coverage detected