https://github.com/python/cpython/commit/df2538adfdc8676b5f9057d2b4002a289d53b136
commit: df2538adfdc8676b5f9057d2b4002a289d53b136
branch: main
author: Petr Vaganov <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-07-01T19:38:09+02:00
summary:

gh-152682: Remove non-functional 
`test_syntax.test_disallowed_type_param_names_oom` (#152770)

files:
M Lib/test/test_syntax.py

diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 80577cf5c84fac..04e60c74ce1bea 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -2861,7 +2861,6 @@ def f(x: *b)
 import unittest
 
 from test import support
-from test.support.script_helper import assert_python_ok
 
 class SyntaxWarningTest(unittest.TestCase):
     def check_warning(self, code, errtext, filename="<testcase>", mode="exec"):
@@ -3202,22 +3201,6 @@ class A:
     class B[{name}]: pass
                 """, "<testcase>", mode="exec")
 
-    @support.nomemtest
-    def test_disallowed_type_param_names_oom(self):
-        # gh-152682: Don't crash on OOM when formatting the SyntaxError message
-        # in symtable_visit_type_param_bound_or_default.
-        code = textwrap.dedent("""\
-            import _testcapi
-            _testcapi.set_nomemory(0)
-            try:
-                compile("class A[__classdict__]: pass", "<string>", "exec")
-            except MemoryError:
-                pass
-            else:
-                raise RuntimeError('MemoryError not raised')
-        """)
-        assert_python_ok("-c", code)
-
     @support.cpython_only
     def test_nested_named_except_blocks(self):
         code = ""

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to