summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-09-30 01:07:04 (GMT)
committerGitHub <noreply@github.com>2024-09-30 01:07:04 (GMT)
commitdceac5b8ea064671aa07b6cb35842955684555f1 (patch)
treecc3c5ea34d066ee6f57e254d2ef774c2ddf157eb
parentdbfc37a5f86196c642e63aee91be70752ad8604c (diff)
downloadcpython-dceac5b8ea064671aa07b6cb35842955684555f1.zip
cpython-dceac5b8ea064671aa07b6cb35842955684555f1.tar.gz
cpython-dceac5b8ea064671aa07b6cb35842955684555f1.tar.bz2
[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 992e8f6102e317b4967a762fbefea82f9fcf9dfb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
-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 753a8da..eb74446 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -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