Issue #16854: Fix regrtest.usage() regression introduced in 6e2e5adc0400.
This fixes a regression introduced in the commit for issue #15302, which
switched regrtest from getopt to argparse.
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index 40d0f97..5b972ca 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -23,10 +23,14 @@
class ParseArgsTestCase(unittest.TestCase):
- """Test that regrtest._parse_args() matches the prior getopt behavior."""
+ """Test that regrtest's parsing code matches the prior getopt behavior."""
def _parse_args(self, args):
- return regrtest._parse_args(args=args)
+ # This is the same logic as that used in regrtest.main()
+ parser = regrtest._create_parser()
+ ns = parser.parse_args(args=args)
+ opts = regrtest._convert_namespace_to_getopt(ns)
+ return opts, ns.args
def _check_args(self, args, expected=None):
"""