Skip to content

Commit

Permalink
pythongh-124245: Fix UserWarning in test_argparse (pythonGH-124246)
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka authored Sep 19, 2024
1 parent 7331d0f commit 992e8f6
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 @@ -5811,9 +5811,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 992e8f6

Please sign in to comment.