diff options
author | Éric Araujo <merwok@netwok.org> | 2010-11-26 00:39:59 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2010-11-26 00:39:59 (GMT) |
commit | 31717e8a5527281d8676a7a2f5023cba007e1770 (patch) | |
tree | 2ae248e5f4801defc03afaa25db9fc700935a120 /Lib | |
parent | 984bb58000df9cdba438c7ecb0bae5ad67878696 (diff) | |
download | cpython-31717e8a5527281d8676a7a2f5023cba007e1770.zip cpython-31717e8a5527281d8676a7a2f5023cba007e1770.tar.gz cpython-31717e8a5527281d8676a7a2f5023cba007e1770.tar.bz2 |
#10453 follow-up: Fix test_quiet on Windows, thanks to Stephan Krah.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_compileall.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index 35b98f3..1955006 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -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): |