From: Douglas Bagnall Date: Tue, 4 Mar 2025 22:39:17 +0000 (+1300) Subject: pytest:samba-tool: .check_output() can set environment X-Git-Tag: tevent-0.17.0~533 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71061b7f16a2900499753b671333e17aebdc08a1;p=thirdparty%2Fsamba.git pytest:samba-tool: .check_output() can set environment Signed-off-by: Douglas Bagnall Reviewed-by: Rowland Penny --- 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: