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

Method test_env

Lib/test/test_subprocess.py:793–802  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

791 proc.kill()
792
793 def test_env(self):
794 newenv = os.environ.copy()
795 newenv["FRUIT"] = "orange"
796 with subprocess.Popen([sys.executable, "-c",
797 'import sys,os;'
798 'sys.stdout.write(os.getenv("FRUIT"))'],
799 stdout=subprocess.PIPE,
800 env=newenv) as p:
801 stdout, stderr = p.communicate()
802 self.assertEqual(stdout, b"orange")
803
804 @unittest.skipUnless(sys.platform == "win32", "Windows only issue")
805 def test_win32_duplicate_envs(self):

Callers

nothing calls this directly

Calls 3

copyMethod · 0.45
communicateMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected