diff options
author | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2023-04-24 10:57:36 +0200 |
---|---|---|
committer | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2023-04-24 10:57:36 +0200 |
commit | c9da8f3e5874e0169ec9ebb26836d65573fa4ae4 (patch) | |
tree | 8b0e53ab967de68e5088882d05bd9871a052654d /tests | |
parent | 65670d74cd28fa63aa7418272b04140daec13322 (diff) | |
parent | 420a59a7da81828e982fabfd34e1533ffddf6400 (diff) | |
download | astroid-git-c9da8f3e5874e0169ec9ebb26836d65573fa4ae4.tar.gz |
Merge branch 'maintenance/2.15.x' into main
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_group_exceptions.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_group_exceptions.py b/tests/test_group_exceptions.py index f000ee99..ce1f142a 100644 --- a/tests/test_group_exceptions.py +++ b/tests/test_group_exceptions.py @@ -54,9 +54,8 @@ def test_group_exceptions() -> None: @pytest.mark.skipif(not PY311_PLUS, reason="Requires Python 3.11 or higher") def test_star_exceptions() -> None: - node = extract_node( - textwrap.dedent( - """ + code = textwrap.dedent( + """ try: raise ExceptionGroup("group", [ValueError(654)]) except* ValueError: @@ -67,9 +66,10 @@ def test_star_exceptions() -> None: sys.exit(127) finally: sys.exit(0)""" - ) ) + node = extract_node(code) assert isinstance(node, TryStar) + assert node.as_string() == code.replace('"', "'").strip() assert isinstance(node.body[0], Raise) assert node.block_range(1) == (1, 11) assert node.block_range(2) == (2, 2) |