summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-08-22 17:17:32 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2014-08-22 17:17:32 (GMT)
commit31f8a677a464300696d794b4ee179bbb66b84080 (patch)
treed4399e2570fe74ae93101dab91d2723c9ed8fb10
parenteb265ab873b6341444f0a5fc3967572688fafe62 (diff)
downloadcpython-31f8a677a464300696d794b4ee179bbb66b84080.zip
cpython-31f8a677a464300696d794b4ee179bbb66b84080.tar.gz
cpython-31f8a677a464300696d794b4ee179bbb66b84080.tar.bz2
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.
-rw-r--r--Lib/test/test_py_compile.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
index 154c08a..5edfafd 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()