MCPcopy Index your code
hub / github.com/RustPython/RustPython / execute

Method execute

Lib/test/test_asyncio/test_subprocess.py:666–683  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Calls 5

joinMethod · 0.45
readMethod · 0.45
sleepMethod · 0.45
assertRaisesMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected