MCPcopy Index your code
hub / github.com/python/cpython / execute

Method execute

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

Source from the content-addressed store, hash-verified

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

Callers 15

persistent_loadMethod · 0.45
mainFunction · 0.45
executeFunction · 0.45
_iterdumpFunction · 0.45
_completeFunction · 0.45
db_contentMethod · 0.45
setUpMethod · 0.45
test_statement_resetMethod · 0.45

Calls 5

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

Tested by

no test coverage detected