From 2fe3912a07409abdc641cc9e25399a840f41938d Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 1 Dec 2022 23:34:00 +0100 Subject: [PATCH] Fixed version test #129 --- unittests/unittests_shared/cli_commands.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/unittests/unittests_shared/cli_commands.py b/unittests/unittests_shared/cli_commands.py index ee7821f4..eb0f2f1f 100644 --- a/unittests/unittests_shared/cli_commands.py +++ b/unittests/unittests_shared/cli_commands.py @@ -24,14 +24,13 @@ class CLICommands: @staticmethod def _run_with_output(cmd: str, *args) -> str: env_vars = os.environ - # env_vars['CPL_IS_UNITTEST'] = 'NO' + env_vars['CPL_IS_UNITTEST'] = 'NO' command = ['python', CLI_PATH, cmd] for arg in args: command.append(arg) - with subprocess.Popen(command, stdout=subprocess.PIPE, universal_newlines=True) as process: - return process.stdout.read() + return subprocess.run(command, env=env_vars, check=True, capture_output=True, text=True).stdout @classmethod def add(cls, source: str, target: str, output=False):