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

Method main

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

Source from the content-addressed store, hash-verified

770
771 def test_create_subprocess_env_shell(self) -> None:
772 async def main() -> None:
773 executable = sys.executable
774 if sys.platform == "win32":
775 executable = f'"{executable}"'
776 cmd = f'''{executable} -c "import os, sys; sys.stdout.write(os.getenv('FOO'))"'''
777 env = os.environ.copy()
778 env["FOO"] = "bar"
779 proc = await asyncio.create_subprocess_shell(
780 cmd, env=env, stdout=subprocess.PIPE
781 )
782 return proc
783
784 self.loop.run_until_complete(self.check_stdout_output(main(), b'bar'))
785

Callers 1

test_subprocess.pyFile · 0.45

Calls 13

MyProtocolClass · 0.85
get_command_stdoutFunction · 0.85
assertNotEqualMethod · 0.80
copyMethod · 0.45
communicateMethod · 0.45
assertEqualMethod · 0.45
gatherMethod · 0.45
waitMethod · 0.45
subprocess_execMethod · 0.45
closeMethod · 0.45
sleepMethod · 0.45
send_signalMethod · 0.45

Tested by

no test coverage detected