mirror of
https://github.com/python/cpython.git
synced 2025-09-01 06:28:36 +00:00
gh-124245: Fix UserWarning in test_argparse (GH-124246)
This commit is contained in:
parent
7331d0f70b
commit
992e8f6102
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue