Skip to content

Commit 02a91ea

Browse files
[3.14] Add test coverage to check execution of GetoptError.__str__ (GH-153941) (#153998)
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 27c5953 commit 02a91ea

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
@@ -198,6 +198,10 @@ def test_issue4629(self):
198198
self.assertEqual(longopts, [('--help', 'x')])
199199
self.assertRaises(getopt.GetoptError, getopt.getopt, ['--help='], '', ['help'])
200200

201+
def test_getopt_error_str(self):
202+
error = getopt.GetoptError('option -a not recognized', 'a')
203+
self.assertEqual(str(error), 'option -a not recognized')
204+
201205
def test_libref_examples():
202206
"""
203207
Examples from the Library Reference: Doc/lib/libgetopt.tex

0 commit comments

Comments
 (0)