Bug 1267454 - Allow passing kwargs to the mocked check_output in configure tests. draft
authorChris Manchester <cmanchester@mozilla.com>
Thu, 05 May 2016 16:02:03 -0700
changeset 363982 c666a9fbdf39f6a61ec3baed66cb5d337f6e8224
parent 363981 21af16108f74b7acd9b78ee42f7cf7ba2fb89a15
child 363983 2e658c05c8e4ff5a6bb9d0d2f8b0c869f221ca47
push id17355
push usercmanchester@mozilla.com
push dateThu, 05 May 2016 23:02:20 +0000
bugs1267454
milestone49.0a1
Bug 1267454 - Allow passing kwargs to the mocked check_output in configure tests. MozReview-Commit-ID: BH3nUUI9nwn
python/mozbuild/mozbuild/test/configure/common.py
--- a/python/mozbuild/mozbuild/test/configure/common.py
+++ b/python/mozbuild/mozbuild/test/configure/common.py
@@ -100,16 +100,17 @@ class ConfigureTestSandbox(ConfigureSand
         if what == 'subprocess.Popen':
             return self.Popen
 
         if what == 'subprocess':
             return ReadOnlyNamespace(
                 CalledProcessError=subprocess.CalledProcessError,
                 check_output=self.check_output,
                 PIPE=subprocess.PIPE,
+                STDOUT=subprocess.STDOUT,
                 Popen=self.Popen,
             )
 
         if what == 'os.environ':
             return self._environ
 
         return super(ConfigureTestSandbox, self)._get_one_import(what)
 
@@ -133,18 +134,18 @@ class ConfigureTestSandbox(ConfigureSand
             def communicate(self, stdin=None):
                 return stdout, stderr
 
             def wait(self):
                 return retcode
 
         return Process()
 
-    def check_output(self, args):
-        proc = self.Popen(args)
+    def check_output(self, args, **kwargs):
+        proc = self.Popen(args, **kwargs)
         stdout, stderr = proc.communicate()
         retcode = proc.wait()
         if retcode:
             raise subprocess.CalledProcessError(retcode, args, stdout)
         return stdout
 
     def shell(self, stdin, args):
         script = mozpath.abspath(args[0])