mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-102856: Initial implementation of PEP 701 (#102855)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Batuhan Taskaya <isidentical@gmail.com> Co-authored-by: Marta Gómez Macías <mgmacias@google.com> Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
This commit is contained in:
parent
a6b07b5a34
commit
1ef61cf71a
27 changed files with 8859 additions and 6573 deletions
|
@ -4,6 +4,7 @@ import sys
|
|||
from test import support
|
||||
from test.support import os_helper
|
||||
from test.support import script_helper
|
||||
from test.support import warnings_helper
|
||||
import unittest
|
||||
|
||||
class EOFTestCase(unittest.TestCase):
|
||||
|
@ -36,10 +37,11 @@ class EOFTestCase(unittest.TestCase):
|
|||
rc, out, err = script_helper.assert_python_failure(file_name)
|
||||
self.assertIn(b'unterminated triple-quoted string literal (detected at line 3)', err)
|
||||
|
||||
@warnings_helper.ignore_warnings(category=SyntaxWarning)
|
||||
def test_eof_with_line_continuation(self):
|
||||
expect = "unexpected EOF while parsing (<string>, line 1)"
|
||||
try:
|
||||
compile('"\\xhh" \\', '<string>', 'exec', dont_inherit=True)
|
||||
compile('"\\Xhh" \\', '<string>', 'exec')
|
||||
except SyntaxError as msg:
|
||||
self.assertEqual(str(msg), expect)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue