[3.13] gh-124245: Fix UserWarning in test_argparse (GH-124246) (#124255)

gh-124245: Fix UserWarning in test_argparse (GH-124246)
(cherry picked from commit 992e8f6102)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-09-30 03:07:04 +02:00 committed by GitHub
parent dbfc37a5f8
commit dceac5b8ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5874,9 +5874,8 @@ class TestIntermixedArgs(TestCase):
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