Skip to content

Commit

Permalink
[3.13] gh-124245: Fix UserWarning in test_argparse (GH-124246) (#124255)
Browse files Browse the repository at this point in the history
gh-124245: Fix UserWarning in test_argparse (GH-124246)
(cherry picked from commit 992e8f6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
  • Loading branch information
miss-islington and serhiy-storchaka committed Sep 30, 2024
1 parent dbfc37a commit dceac5b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Lib/test/test_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -5874,9 +5874,8 @@ def test_invalid_args(self):
parser = ErrorRaisingArgumentParser(prog='PROG')
parser.add_argument('--foo', nargs="*")
parser.add_argument('foo')
with captured_stderr() as stderr:
with self.assertWarns(UserWarning):
parser.parse_intermixed_args(['hello', '--foo'])
self.assertIn("UserWarning", stderr.getvalue())

class TestIntermixedMessageContentError(TestCase):
# case where Intermixed gives different error message
Expand Down

0 comments on commit dceac5b

Please sign in to comment.