Skip to content

Commit

Permalink
Update subprocess call in IsolatedEnvironment class and test case.- U…
Browse files Browse the repository at this point in the history
…se capture_output in test case for "git --version".
  • Loading branch information
zackees committed Aug 19, 2024
1 parent 7d7aa15 commit 690cbdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/isolated_environment/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,10 @@ def run(self, cmd_list: list[str], **kwargs) -> subprocess.CompletedProcess:
)
):
cmd_list[0] = str(act_env.pip)
shell = kwargs.get("shell", False)
cmd_or_cmd_list = subprocess.list2cmdline(cmd_list) if shell else cmd_list
cp = subprocess.run(
cmd_list,
cmd_or_cmd_list,
env=env,
check=check,
text=text,
Expand Down
4 changes: 3 additions & 1 deletion tests/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ def test_git_is_still_installed(self) -> None:
)
activated_env = iso_env.environment()
# now create an inner environment without the static-ffmpeg
cp: subprocess.CompletedProcess = iso_env.run(["git", "--help"], shell=True)
cp: subprocess.CompletedProcess = iso_env.run(
["git", "--version"], shell=True, capture_output=True
)
if cp.returncode != 0:
warning_message = [
"git had some sort of a problem, dumping out the system"
Expand Down

0 comments on commit 690cbdc

Please sign in to comment.