From dceac5b8ea064671aa07b6cb35842955684555f1 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 30 Sep 2024 03:07:04 +0200 Subject: [PATCH] [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 --- Lib/test/test_argparse.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py index 753a8dad719..eb744468b55 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