]> granicus.if.org Git - python/commitdiff
Issue #19447: Suppress output of py_compile.compile().
authorBerker Peksag <berker.peksag@gmail.com>
Mon, 1 Sep 2014 09:29:53 +0000 (12:29 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Mon, 1 Sep 2014 09:29:53 +0000 (12:29 +0300)
Lib/test/test_py_compile.py

index 640dcc3b079d2af4cf1f6fc0b11ee62e57cadfc8..0a7e2f8ad6be995fd4b7ce08ad187b8effcda461 100644 (file)
@@ -94,7 +94,8 @@ class PyCompileTests(unittest.TestCase):
 
     def test_bad_coding(self):
         bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py')
-        self.assertIsNone(py_compile.compile(bad_coding, doraise=False))
+        with support.captured_stderr():
+            self.assertIsNone(py_compile.compile(bad_coding, doraise=False))
         self.assertFalse(os.path.exists(
             importlib.util.cache_from_source(bad_coding)))