mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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.
This commit is contained in:
parent
eb265ab873
commit
31f8a677a4
1 changed files with 4 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue