From d5e3c7b5066a696ebbd5fb6e200bd98b0110ef6b Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:15:15 +0300 Subject: [PATCH 1/5] Update `test_patma.py` to 3.14.6 --- Lib/test/test_patma.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Lib/test/test_patma.py b/Lib/test/test_patma.py index 5a06972fdde..5d0857b059e 100644 --- a/Lib/test/test_patma.py +++ b/Lib/test/test_patma.py @@ -6,6 +6,7 @@ import inspect import sys import unittest +from test import support @dataclasses.dataclass @@ -2563,15 +2564,14 @@ def test_patma_240(self): self.assertEqual(y, 0) self.assertEqual(z, {0: 1}) - # TODO: RUSTPYTHON - # def test_patma_241(self): - # x = [[{0: 0}]] - # match x: - # case list([({-0-0j: int(real=0+0j, imag=0-0j) | (1) as z},)]): - # y = 0 - # self.assertEqual(x, [[{0: 0}]]) - # self.assertEqual(y, 0) - # self.assertEqual(z, 0) + def test_patma_241(self): + x = [[{0: 0}]] + match x: + case list([({-0-0j: int(real=0+0j, imag=0-0j) | (1) as z},)]): + y = 0 + self.assertEqual(x, [[{0: 0}]]) + self.assertEqual(y, 0) + self.assertEqual(z, 0) def test_patma_242(self): x = range(3) @@ -3016,6 +3016,13 @@ def test_multiple_assignments_to_name_in_pattern_5(self): pass """) + def test_multiple_assignments_to_name_in_pattern_6(self): + self.assert_syntax_error(""" + match ...: + case a as a + 1: # NAME and expression with no () + pass + """) + def test_multiple_starred_names_in_sequence_pattern_0(self): self.assert_syntax_error(""" match ...: @@ -3492,6 +3499,7 @@ def f(command): # 0 self.assertListEqual(self._trace(f, 1), [1, 2, 3]) self.assertListEqual(self._trace(f, 0), [1, 2, 5, 6]) + @support.skip_wasi_stack_overflow() def test_parser_deeply_nested_patterns(self): # Deeply nested patterns can cause exponential backtracking when parsing. # See gh-93671 for more information. From 89b109acc602f284560e91b9a665ea6617f0a2a4 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:15:34 +0300 Subject: [PATCH 2/5] Update `test_listcomps.py` --- Lib/test/test_listcomps.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Lib/test/test_listcomps.py b/Lib/test/test_listcomps.py index 5e09fad72d8..e76169c69df 100644 --- a/Lib/test/test_listcomps.py +++ b/Lib/test/test_listcomps.py @@ -206,11 +206,9 @@ class i: [__classdict__ for x in y] """ self._check_in_scopes(code, raises=NameError) - @unittest.expectedFailure # TODO: RUSTPYTHON; SyntaxError: compiler_make_closure: cannot find '__classdict__' in parent vars def test_references___classdict___nested(self): class _C: - # res = [(lambda: __classdict__)() for _ in [1]] # TODO: RUSTPYTHON - pass # TODO: RUSTPYTHON + res = [(lambda: __classdict__)() for _ in [1]] self.assertIn("res", _C.res[0]) def test_references___conditional_annotations__(self): From dfee2090eecb994083d8537e395e724b9e3e69c5 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:16:43 +0300 Subject: [PATCH 3/5] Align patches of `test_super.py` --- Lib/test/test_super.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_super.py b/Lib/test/test_super.py index b53e38c77f4..4d338bbbc5a 100644 --- a/Lib/test/test_super.py +++ b/Lib/test/test_super.py @@ -112,7 +112,7 @@ def f(): __class__""", globals(), {}) self.assertIs(type(e.exception), NameError) # Not UnboundLocalError class X: - # global __class__ # TODO: RUSTPYTHON; SyntaxError: name '__class__' is assigned to before global declaration + global __class__ __class__ = 42 def f(): __class__ @@ -120,7 +120,7 @@ def f(): del globals()["__class__"] self.assertNotIn("__class__", X.__dict__) class X: - # nonlocal __class__ # TODO: RUSTPYTHON; SyntaxError: name '__class__' is assigned to before nonlocal declaration + nonlocal __class__ __class__ = 42 def f(): __class__ From de9a1a161876fe10b946b2af642cec42c5317549 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:22:31 +0300 Subject: [PATCH 4/5] Align `test_grammar.py` --- Lib/test/test_grammar.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 19440b10115..cfb24a5c457 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -1723,8 +1723,7 @@ class G: pass class H: pass @d := class_decorator class I: pass - # TODO: RUSTPYTHON; SyntaxError: the symbol 'class_decorator' must be present in the symbol table - # @lambda c: class_decorator(c) + @lambda c: class_decorator(c) class J: pass @[..., class_decorator, ...][1] class K: pass From 35398bdee31de62a0585f0909327f41faab7da3f Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:23:48 +0300 Subject: [PATCH 5/5] Align patches for `test_pep646_syntax.py` --- Lib/test/test_pep646_syntax.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/test/test_pep646_syntax.py b/Lib/test/test_pep646_syntax.py index d79196219fe..aac089b190b 100644 --- a/Lib/test/test_pep646_syntax.py +++ b/Lib/test/test_pep646_syntax.py @@ -321,8 +321,7 @@ __test__ = {'doctests' : doctests} def load_tests(loader, tests, pattern): - from test.support.rustpython import DocTestChecker # TODO: RUSTPYTHON - tests.addTest(doctest.DocTestSuite(checker=DocTestChecker())) # TODO: RUSTPYTHON + tests.addTest(doctest.DocTestSuite()) return tests