mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Update test_eof.py from CPython v3.12.0
This commit is contained in:
1 parent
1d76b762c7
commit
ad3f0aecaf
1 file changed
+3
-1
Vendored
+3
-1
@@ -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
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@@ -38,10 +39,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:
|
||||
|
||||
Reference in new issue
Block a user