#11955: show the list of args in case of error in test_argparse.
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index 8a4fdb9..b615722 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -235,8 +235,8 @@
parser = self._get_parser(tester)
for args_str in tester.failures:
args = args_str.split()
- raises = tester.assertRaises
- raises(ArgumentParserError, parser.parse_args, args)
+ with tester.assertRaises(ArgumentParserError, msg=args):
+ parser.parse_args(args)
def test_successes(self, tester):
parser = self._get_parser(tester)