Skip to content

Commit dceac5b

Browse files
[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 992e8f6) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent dbfc37a commit dceac5b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Lib/test/test_argparse.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5874,9 +5874,8 @@ def test_invalid_args(self):
58745874
parser = ErrorRaisingArgumentParser(prog='PROG')
58755875
parser.add_argument('--foo', nargs="*")
58765876
parser.add_argument('foo')
5877-
with captured_stderr() as stderr:
5877+
with self.assertWarns(UserWarning):
58785878
parser.parse_intermixed_args(['hello', '--foo'])
5879-
self.assertIn("UserWarning", stderr.getvalue())
58805879

58815880
class TestIntermixedMessageContentError(TestCase):
58825881
# case where Intermixed gives different error message

0 commit comments

Comments
 (0)