diff options
Diffstat (limited to 'Lib/test/test_getopt.py')
-rw-r--r-- | Lib/test/test_getopt.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_getopt.py b/Lib/test/test_getopt.py index 13e1980251..a265b6b08a 100644 --- a/Lib/test/test_getopt.py +++ b/Lib/test/test_getopt.py @@ -173,6 +173,12 @@ class GetoptTests(unittest.TestCase): m = types.ModuleType("libreftest", s) run_doctest(m, verbose) + def test_issue4629(self): + longopts, shortopts = getopt.getopt(['--help='], '', ['help=']) + self.assertEquals(longopts, [('--help', '')]) + longopts, shortopts = getopt.getopt(['--help=x'], '', ['help=']) + self.assertEquals(longopts, [('--help', 'x')]) + self.assertRaises(getopt.GetoptError, getopt.getopt, ['--help='], '', ['help']) def test_main(): run_unittest(GetoptTests) |