]> granicus.if.org Git - python/commitdiff
Issue #19447: Add a test case to py_compile.compile() to make sure
authorBerker Peksag <berker.peksag@gmail.com>
Fri, 22 Aug 2014 17:17:32 +0000 (20:17 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Fri, 22 Aug 2014 17:17:32 +0000 (20:17 +0300)
it don't raise an exception if doraise is False.

Patch by Bohuslav "Slavek" Kabrda.

Lib/test/test_py_compile.py

index 154c08a6a2e481dd2b60d4f97d875f8cd20eee93..5edfafd96f319e6bdbd1a5a255aa2659487d7d58 100644 (file)
@@ -92,6 +92,10 @@ class PyCompileTests(unittest.TestCase):
         finally:
             os.chmod(self.directory, mode.st_mode)
 
+    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))
+        self.assertFalse(os.path.exists(bad_coding + 'c'))
 
 if __name__ == "__main__":
     unittest.main()