From ad3f0aecafeae690e6de2bad727db786cd82d3af Mon Sep 17 00:00:00 2001 From: NakanoMiku Date: Thu, 30 Nov 2023 21:05:18 +0800 Subject: [PATCH] Update test_eof.py from CPython v3.12.0 --- Lib/test/test_eof.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py index 21f83db75..cf12dd3d5 100644 --- a/Lib/test/test_eof.py +++ b/Lib/test/test_eof.py @@ -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 (, line 1)" try: - compile('"\\xhh" \\', '', 'exec', dont_inherit=True) + compile('"\\Xhh" \\', '', 'exec') except SyntaxError as msg: self.assertEqual(str(msg), expect) else: