Update test_eof.py from CPython v3.12.0

This commit is contained in:
NakanoMiku committed 2023-11-30 21:05:18 +08:00
1 parent 1d76b762c7
commit ad3f0aecaf
1 file changed
+3 -1
+3 -1
View File
@@ -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: