Issue #28409: regrtest: fix the parser of command line arguments.

This commit is contained in:
Victor Stinner 2016-10-17 18:11:03 +02:00
parent 5493e4723a
commit 1f6b69b749
3 changed files with 21 additions and 6 deletions

View file

@ -270,6 +270,16 @@ class ParseArgsTestCase(unittest.TestCase):
self.assertEqual(ns.verbose, 0)
self.assertEqual(ns.args, ['foo'])
def test_arg_option_arg(self):
ns = regrtest._parse_args(['test_unaryop', '-v', 'test_binop'])
self.assertEqual(ns.verbose, 1)
self.assertEqual(ns.args, ['test_unaryop', 'test_binop'])
def test_unknown_option(self):
self.checkError(['--unknown-option'],
'unrecognized arguments: --unknown-option')
if __name__ == '__main__':
unittest.main()