Skip to content

Commit d7f7f9d

Browse files
authored
Fix test_add_subparsers_twice with Python 3.12.5
1 parent b569790 commit d7f7f9d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/test_subparser.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,12 @@ def configure(self):
134134
self.add_subparsers(help="sub-command1 help")
135135
self.add_subparsers(help="sub-command2 help")
136136

137-
with self.assertRaises(SystemExit):
138-
Args().parse_args([])
137+
if sys.version_info >= (3, 12, 5):
138+
with self.assertRaises(ArgumentError):
139+
Args().parse_args([])
140+
else:
141+
with self.assertRaises(SystemExit):
142+
Args().parse_args([])
139143

140144
def test_add_subparsers_with_add_argument(self):
141145
class SubparserA(Tap):

0 commit comments

Comments
 (0)