From ee4de09c4e0c768e96ed6279de1aefa5d5e93125 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Mon, 2 Oct 2023 19:03:07 +1100 Subject: [PATCH] Limit try-except-star to Python 3.11 and above --- ropetest/refactor/extracttest.py | 1 + ropetest/refactor/patchedasttest.py | 1 + 2 files changed, 2 insertions(+) diff --git a/ropetest/refactor/extracttest.py b/ropetest/refactor/extracttest.py index 9fc580f6f..ed4054c06 100644 --- a/ropetest/refactor/extracttest.py +++ b/ropetest/refactor/extracttest.py @@ -1809,6 +1809,7 @@ def g(): """) self.assertEqual(expected, refactored) + @testutils.only_for_versions_higher("3.11") def test_extract_method_and_try_except_star_block_1(self): code = dedent("""\ def f(): diff --git a/ropetest/refactor/patchedasttest.py b/ropetest/refactor/patchedasttest.py index 0236ec719..3ac341f25 100644 --- a/ropetest/refactor/patchedasttest.py +++ b/ropetest/refactor/patchedasttest.py @@ -1154,6 +1154,7 @@ def test_try_except_and_finally_node(self): expected_children = ["try", "", ":", "\n ", "Pass", "\n", "ExceptHandler", "\n", "finally", "", ":", "\n ", "Pass"] checker.check_children(node_to_test, expected_children) + @testutils.only_for_versions_higher("3.11") def test_try_except_group_node(self): source = dedent("""\ try: