()
| 1266 | time.sleep(1) |
| 1267 | |
| 1268 | async def main(): |
| 1269 | loop = asyncio.get_running_loop() |
| 1270 | loop.add_signal_handler(signal.SIGTERM, lambda *args: parent_handled.set()) |
| 1271 | |
| 1272 | process = ctx.Process(target=child_main) |
| 1273 | process.start() |
| 1274 | child_started.wait() |
| 1275 | os.kill(process.pid, signal.SIGTERM) |
| 1276 | process.join(timeout=support.SHORT_TIMEOUT) |
| 1277 | |
| 1278 | async def func(): |
| 1279 | await asyncio.sleep(0.1) |
| 1280 | return 42 |
| 1281 | |
| 1282 | # Test parent's loop is still functional |
| 1283 | self.assertEqual(await asyncio.create_task(func()), 42) |
| 1284 | |
| 1285 | asyncio.run(main()) |
| 1286 |
no test coverage detected