From 318f8949c9e16b52f740dd6ffa5140310217ebb9 Mon Sep 17 00:00:00 2001 From: Yabets Mebratu Date: Sun, 31 May 2026 13:31:59 -0700 Subject: [PATCH] fix(B602): replace shell=True with shlex.split() in test_cli.py subprocess calls --- libs/executors/tests/end-to-end/test_cli.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/libs/executors/tests/end-to-end/test_cli.py b/libs/executors/tests/end-to-end/test_cli.py index 1471832e..b26db78d 100644 --- a/libs/executors/tests/end-to-end/test_cli.py +++ b/libs/executors/tests/end-to-end/test_cli.py @@ -16,6 +16,7 @@ import json import pathlib +import shlex import subprocess import sys @@ -99,8 +100,7 @@ def test_fake_source_from_console(self, command): '--loglevel ERROR' ) result = subprocess.run( - command, - shell=True, + shlex.split(command), check=False, capture_output=True, text=True, @@ -123,8 +123,7 @@ def test_fake_source_from_file(self, tmp_path, command): '--loglevel ERROR' ) result = subprocess.run( - command, - shell=True, + shlex.split(command), check=False, capture_output=True, text=True, @@ -146,8 +145,7 @@ def test_fake_source_from_config(self, tmp_path, command): '--loglevel ERROR' ) result = subprocess.run( - command, - shell=True, + shlex.split(command), check=False, capture_output=True, text=True, @@ -162,8 +160,7 @@ def test_fake_source_from_workflow(self, command): workflow_path = _SCRIPT_PATH / 'test_workflow.yaml' command = f'{command} {str(workflow_path)} --loglevel ERROR' result = subprocess.run( - command, - shell=True, + shlex.split(command), check=False, capture_output=True, text=True, @@ -183,8 +180,7 @@ def test_fake_source_from_workflow_with_config(self, command, tmp_path): f'{command} {str(workflow_path)} --loglevel ERROR -c {str(tmp_config)}' ) result = subprocess.run( - command, - shell=True, + shlex.split(command), check=False, capture_output=True, text=True,