From: Berker Peksag Date: Fri, 22 Aug 2014 17:17:32 +0000 (+0300) Subject: Issue #19447: Add a test case to py_compile.compile() to make sure X-Git-Tag: v3.4.2rc1~98 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=31f8a677a464300696d794b4ee179bbb66b84080;p=thirdparty%2FPython%2Fcpython.git Issue #19447: Add a test case to py_compile.compile() to make sure it don't raise an exception if doraise is False. Patch by Bohuslav "Slavek" Kabrda. --- diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py index 154c08a6a2e4..5edfafd96f31 100644 --- a/Lib/test/test_py_compile.py +++ b/Lib/test/test_py_compile.py @@ -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()