summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_argparse.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-09-19 18:35:12 (GMT)
committerGitHub <noreply@github.com>2024-09-19 18:35:12 (GMT)
commit992e8f6102e317b4967a762fbefea82f9fcf9dfb (patch)
tree606fa2d7f58c1fb7d817aa8e478c82da894e4258 /Lib/test/test_argparse.py
parent7331d0f70bc9fbac177b76b6ec03486430383425 (diff)
downloadcpython-992e8f6102e317b4967a762fbefea82f9fcf9dfb.zip
cpython-992e8f6102e317b4967a762fbefea82f9fcf9dfb.tar.gz
cpython-992e8f6102e317b4967a762fbefea82f9fcf9dfb.tar.bz2
gh-124245: Fix UserWarning in test_argparse (GH-124246)
Diffstat (limited to 'Lib/test/test_argparse.py')
-rw-r--r--Lib/test/test_argparse.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index 584462b..435db65 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -5811,9 +5811,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