bpo-43892: Make match patterns explicit in the AST (GH-25585)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
diff --git a/Lib/test/test_patma.py b/Lib/test/test_patma.py
index 40580be..f327552 100644
--- a/Lib/test/test_patma.py
+++ b/Lib/test/test_patma.py
@@ -2857,6 +2857,22 @@ class Class:
self.assertIs(y, None)
self.assertIs(z, None)
+ @no_perf
+ def test_patma_283(self):
+ self.assert_syntax_error("""
+ match ...:
+ case {0+0: _}:
+ pass
+ """)
+
+ @no_perf
+ def test_patma_284(self):
+ self.assert_syntax_error("""
+ match ...:
+ case {f"": _}:
+ pass
+ """)
+
class PerfPatma(TestPatma):
diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py
index ce03272..9f67b49 100644
--- a/Lib/test/test_unparse.py
+++ b/Lib/test/test_unparse.py
@@ -518,7 +518,8 @@ class DirectoryTestCase(ASTTestCase):
lib_dir = pathlib.Path(__file__).parent / ".."
test_directories = (lib_dir, lib_dir / "test")
run_always_files = {"test_grammar.py", "test_syntax.py", "test_compile.py",
- "test_ast.py", "test_asdl_parser.py", "test_fstring.py"}
+ "test_ast.py", "test_asdl_parser.py", "test_fstring.py",
+ "test_patma.py"}
_files_to_test = None