From 71061b7f16a2900499753b671333e17aebdc08a1 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 5 Mar 2025 11:39:17 +1300 Subject: [PATCH] pytest:samba-tool: .check_output() can set environment Signed-off-by: Douglas Bagnall Reviewed-by: Rowland Penny --- python/samba/tests/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py index ef57309ab70..6af0940e8e4 100644 --- a/python/samba/tests/__init__.py +++ b/python/samba/tests/__init__.py @@ -544,11 +544,11 @@ class BlackboxTestCase(TestCaseInTempDir): return stdoutdata @classmethod - def check_output(cls, line): + def check_output(cls, line, env=None): use_shell = not isinstance(line, list) line = cls._make_cmdline(line) p = subprocess.Popen(line, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - shell=use_shell, close_fds=True) + shell=use_shell, close_fds=True, env=env) stdoutdata, stderrdata = p.communicate() retcode = p.returncode if retcode: -- 2.47.2