https://github.com/python/cpython/commit/992e8f6102e317b4967a762fbefea82f9fcf9dfb
commit: 992e8f6102e317b4967a762fbefea82f9fcf9dfb
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-09-19T21:35:12+03:00
summary:

gh-124245: Fix UserWarning in test_argparse (GH-124246)

files:
M Lib/test/test_argparse.py

diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index 584462b741ee99..435db65d52fddb 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -5811,9 +5811,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