Skip to content

Commit 9adef68

Browse files
authored
Add test coverage to check execution of GetoptError.__str__ (#153941)
* Increase test coverage of getopt to check execution of GetoptError.__str__ * Add test coverage to check execution of GetoptError.__str__ * Add test coverage to check execution of GetoptError.__str__ * Add test coverage to check execution of GetoptError.__str__ * Add test coverage to check execution of GetoptError.__str__ * Add test coverage to check execution of GetoptError.__str__
1 parent 46e950f commit 9adef68

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
@@ -229,6 +229,10 @@ def test_issue4629(self):
229229
self.assertEqual(longopts, [('--help', 'x')])
230230
self.assertRaises(getopt.GetoptError, getopt.getopt, ['--help='], '', ['help'])
231231

232+
def test_getopt_error_str(self):
233+
error = getopt.GetoptError('option -a not recognized', 'a')
234+
self.assertEqual(str(error), 'option -a not recognized')
235+
232236
def test_libref_examples():
233237
"""
234238
Examples from the Library Reference: Doc/lib/libgetopt.tex

0 commit comments

Comments
 (0)