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

Method empty_input

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

Source from the content-addressed store, hash-verified

438 def test_empty_input(self):
439
440 async def empty_input():
441 code = 'import sys; data = sys.stdin.read(); print(len(data))'
442 proc = await asyncio.create_subprocess_exec(
443 sys.executable, '-c', code,
444 stdin=asyncio.subprocess.PIPE,
445 stdout=asyncio.subprocess.PIPE,
446 stderr=asyncio.subprocess.PIPE,
447 close_fds=False,
448 )
449 stdout, stderr = await proc.communicate(b'')
450 exitcode = await proc.wait()
451 return (stdout, exitcode)
452
453 output, exitcode = self.loop.run_until_complete(empty_input())
454 self.assertEqual(output.rstrip(), b'0')

Callers

nothing calls this directly

Calls 2

communicateMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected