diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2021-12-14 16:48:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-14 16:48:15 (GMT) |
commit | d60457a6673cf0263213c2f2be02c633ec2e2038 (patch) | |
tree | 04461db9079cf30a98c5a4070098f795275aa910 /Lib/test/test_unparse.py | |
parent | 850aefc2c651110a784cd5478af9774b1f6287a3 (diff) | |
download | cpython-d60457a6673cf0263213c2f2be02c633ec2e2038.zip cpython-d60457a6673cf0263213c2f2be02c633ec2e2038.tar.gz cpython-d60457a6673cf0263213c2f2be02c633ec2e2038.tar.bz2 |
bpo-45292: [PEP-654] add except* (GH-29581)
Diffstat (limited to 'Lib/test/test_unparse.py')
-rw-r--r-- | Lib/test/test_unparse.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py index d8ba487..f5be13a 100644 --- a/Lib/test/test_unparse.py +++ b/Lib/test/test_unparse.py @@ -93,6 +93,19 @@ finally: suite5 """ +try_except_star_finally = """\ +try: + suite1 +except* ex1: + suite2 +except* ex2: + suite3 +else: + suite4 +finally: + suite5 +""" + with_simple = """\ with f(): suite1 @@ -304,6 +317,9 @@ class UnparseTestCase(ASTTestCase): def test_try_except_finally(self): self.check_ast_roundtrip(try_except_finally) + def test_try_except_star_finally(self): + self.check_ast_roundtrip(try_except_star_finally) + def test_starred_assignment(self): self.check_ast_roundtrip("a, *b, c = seq") self.check_ast_roundtrip("a, (*b, c) = seq") |