()
| 664 | def test_read_stdout_after_process_exit(self): |
| 665 | |
| 666 | async def execute(): |
| 667 | code = '\n'.join(['import sys', |
| 668 | 'for _ in range(64):', |
| 669 | ' sys.stdout.write("x" * 4096)', |
| 670 | 'sys.stdout.flush()', |
| 671 | 'sys.exit(1)']) |
| 672 | |
| 673 | process = await asyncio.create_subprocess_exec( |
| 674 | sys.executable, '-c', code, |
| 675 | stdout=asyncio.subprocess.PIPE, |
| 676 | ) |
| 677 | |
| 678 | while True: |
| 679 | data = await process.stdout.read(65536) |
| 680 | if data: |
| 681 | await asyncio.sleep(0.3) |
| 682 | else: |
| 683 | break |
| 684 | |
| 685 | self.loop.run_until_complete(execute()) |
| 686 |
no test coverage detected