Skip to content

Commit 05c7060

Browse files
committed
Add test coverage to check execution of GetoptError.__str__
1 parent e836a29 commit 05c7060

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/test/test_getopt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ def test_issue4629(self):
206206
self.assertEqual(longopts, [('--help', 'x')])
207207
self.assertRaises(getopt.GetoptError, getopt.getopt, ['--help='], '', ['help'])
208208

209+
def test_getopt_error_str(self):
210+
error = getopt.GetoptError('option -a not recognized', 'a')
211+
self.assertEqual(str(error), 'option -a not recognized')
212+
209213
def test_libref_examples():
210214
"""
211215
Examples from the Library Reference: Doc/lib/libgetopt.tex

0 commit comments

Comments
 (0)