mirror of https://github.com/python/cpython
gh-124245: Fix UserWarning in test_argparse (GH-124246)
This commit is contained in:
parent
7331d0f70b
commit
992e8f6102
|
@ -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…
Reference in New Issue