]> granicus.if.org Git - python/commitdiff
#10453 follow-up: Fix test_quiet on Windows, thanks to Stephan Krah.
authorÉric Araujo <merwok@netwok.org>
Fri, 26 Nov 2010 00:39:59 +0000 (00:39 +0000)
committerÉric Araujo <merwok@netwok.org>
Fri, 26 Nov 2010 00:39:59 +0000 (00:39 +0000)
Lib/test/test_compileall.py

index 35b98f3eddb3a621875474982c0607a063dfac13..1955006fd0f94b274e2924dbcf199651211c07ad 100644 (file)
@@ -137,7 +137,7 @@ class CommandLineTests(unittest.TestCase):
     for name, ext, switch in [
         ('normal', 'pyc', []),
         ('optimize', 'pyo', ['-O']),
-        ('doubleoptimize', 'pyo', ['-OO'])
+        ('doubleoptimize', 'pyo', ['-OO']),
     ]:
         def f(self, ext=ext, switch=switch):
             retcode = subprocess.call(
@@ -200,7 +200,7 @@ class CommandLineTests(unittest.TestCase):
         self.assertNotEqual(access, access2)
 
     def test_legacy(self):
-        # create a new module
+        # create a new module  XXX could rewrite using self.pkgdir
         newpackage = os.path.join(self.pkgdir, 'spam')
         os.mkdir(newpackage)
         with open(os.path.join(newpackage, '__init__.py'), 'w'):
@@ -220,10 +220,12 @@ class CommandLineTests(unittest.TestCase):
         self.assertTrue(os.path.exists(imp.cache_from_source(sourcefile)))
 
     def test_quiet(self):
-        noise = subprocess.getoutput('{} -m compileall {}'.format(
-                                     sys.executable, self.pkgdir))
-        quiet = subprocess.getoutput(('{} -m compileall -f -q {}'.format(
-                                     sys.executable, self.pkgdir)))
+        noise = subprocess.check_output(
+             [sys.executable, '-m', 'compileall', self.pkgdir],
+             stderr=subprocess.STDOUT)
+        quiet = subprocess.check_output(
+            [sys.executable, '-m', 'compileall', '-f', '-q', self.pkgdir],
+            stderr=subprocess.STDOUT)
         self.assertGreater(len(noise), len(quiet))
 
     def test_regexp(self):