gh-124245: Fix UserWarning in test_argparse (GH-124246)

This commit is contained in:
Serhiy Storchaka 2024-09-19 21:35:12 +03:00 committed by GitHub
parent 7331d0f70b
commit 992e8f6102
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -5811,9 +5811,8 @@ class TestIntermixedArgs(TestCase):
parser = ErrorRaisingArgumentParser(prog='PROG') parser = ErrorRaisingArgumentParser(prog='PROG')
parser.add_argument('--foo', nargs="*") parser.add_argument('--foo', nargs="*")
parser.add_argument('foo') parser.add_argument('foo')
with captured_stderr() as stderr: with self.assertWarns(UserWarning):
parser.parse_intermixed_args(['hello', '--foo']) parser.parse_intermixed_args(['hello', '--foo'])
self.assertIn("UserWarning", stderr.getvalue())
class TestIntermixedMessageContentError(TestCase): class TestIntermixedMessageContentError(TestCase):
# case where Intermixed gives different error message # case where Intermixed gives different error message