()
| 695 | def test_read_stdout_after_process_exit(self): |
| 696 | |
| 697 | async def execute(): |
| 698 | code = '\n'.join(['import sys', |
| 699 | 'for _ in range(64):', |
| 700 | ' sys.stdout.write("x" * 4096)', |
| 701 | 'sys.stdout.flush()', |
| 702 | 'sys.exit(1)']) |
| 703 | |
| 704 | process = await asyncio.create_subprocess_exec( |
| 705 | sys.executable, '-c', code, |
| 706 | stdout=asyncio.subprocess.PIPE, |
| 707 | ) |
| 708 | |
| 709 | while True: |
| 710 | data = await process.stdout.read(65536) |
| 711 | if data: |
| 712 | await asyncio.sleep(0.3) |
| 713 | else: |
| 714 | break |
| 715 | |
| 716 | self.loop.run_until_complete(execute()) |
| 717 |
no test coverage detected