diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2021-04-29 05:58:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 05:58:44 (GMT) |
commit | 1e7b858575d0ad782939f86aae4a2fa1c29e9f14 (patch) | |
tree | 9445a7a82905c5bb253564853f33dacfceac6e93 /Lib/test | |
parent | e52ab42cedd2a5ef4c3c1a47d0cf96a8f06d051f (diff) | |
download | cpython-1e7b858575d0ad782939f86aae4a2fa1c29e9f14.zip cpython-1e7b858575d0ad782939f86aae4a2fa1c29e9f14.tar.gz cpython-1e7b858575d0ad782939f86aae4a2fa1c29e9f14.tar.bz2 |
bpo-43892: Make match patterns explicit in the AST (GH-25585)
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_patma.py | 16 | ||||
-rw-r--r-- | Lib/test/test_unparse.py | 3 |
2 files changed, 18 insertions, 1 deletions
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 TestPatma(unittest.TestCase): 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 |