]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest:samba-tool: .check_output() can set environment
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 4 Mar 2025 22:39:17 +0000 (11:39 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 12 Mar 2025 19:57:34 +0000 (19:57 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
python/samba/tests/__init__.py

index ef57309ab70f55eed0883f7ba3a5eeed40bfc50e..6af0940e8e4c5922fbac16851d3111598f2bfe9b 100644 (file)
@@ -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: