(self)
| 1295 | @hashlib_helper.requires_hashdigest('md5') |
| 1296 | @support.skip_if_sanitizer("TSAN doesn't support threads after fork", thread=True) |
| 1297 | def test_fork_asyncio_run(self): |
| 1298 | self.addCleanup(multiprocessing_cleanup_tests) |
| 1299 | |
| 1300 | ctx = multiprocessing.get_context('fork') |
| 1301 | manager = ctx.Manager() |
| 1302 | self.addCleanup(manager.shutdown) |
| 1303 | result = manager.Value('i', 0) |
| 1304 | |
| 1305 | async def child_main(): |
| 1306 | await asyncio.sleep(0.1) |
| 1307 | result.value = 42 |
| 1308 | |
| 1309 | process = ctx.Process(target=lambda: asyncio.run(child_main())) |
| 1310 | process.start() |
| 1311 | process.join() |
| 1312 | |
| 1313 | self.assertEqual(result.value, 42) |
| 1314 | |
| 1315 | @warnings_helper.ignore_fork_in_thread_deprecation_warnings() |
| 1316 | @hashlib_helper.requires_hashdigest('md5') |
nothing calls this directly
no test coverage detected