https://github.com/python/cpython/commit/dceac5b8ea064671aa07b6cb35842955684555f1
commit: dceac5b8ea064671aa07b6cb35842955684555f1
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: Yhg1s <[email protected]>
date: 2024-09-29T18:07:04-07:00
summary:

[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 <[email protected]>

files:
M Lib/test/test_argparse.py

diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index 753a8dad7195ae..eb744468b55602 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -5874,9 +5874,8 @@ def test_invalid_args(self):
         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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to