Skip to content

Commit b51ecd8

Browse files
[3.15] Add test coverage to check execution of GetoptError.__str__ (GH-153941) (#153997)
Add test coverage to check execution of GetoptError.__str__ (GH-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__ (cherry picked from commit 9adef68) Co-authored-by: Manith Hettiarachchilage <manithhetti@gmail.com>
1 parent 9ba9c56 commit b51ecd8

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)