Skip to content

Commit

Permalink
copy environ
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraditya303 committed Dec 28, 2022
1 parent 3da71ff commit 9f93e6d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lib/test/test_asyncio/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,8 @@ async def check_stdout_output(self, coro, output):
def test_create_subprocess_env_shell(self) -> None:
async def main() -> None:
cmd = f'''{sys.executable} -c "import os, sys; sys.stdout.write(os.getenv('FOO'))"'''
env = {"FOO": 'bar'}
env = os.environ.copy()
env["FOO"] = "bar"
proc = await asyncio.create_subprocess_shell(
cmd, env=env, stdout=subprocess.PIPE
)
Expand All @@ -710,7 +711,8 @@ def test_create_subprocess_env_exec(self) -> None:
async def main() -> None:
cmd = [sys.executable, "-c",
"import os, sys; sys.stdout.write(os.getenv('FOO'))"]
env = {"FOO": 'baz'}
env = os.environ.copy()
env["FOO"] = "baz"
proc = await asyncio.create_subprocess_exec(
*cmd, env=env, stdout=subprocess.PIPE
)
Expand Down

0 comments on commit 9f93e6d

Please sign in to comment.