Skip to content

Commit

Permalink
pythongh-95395: Add argument type error test (pythonGH-95412)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaminyam authored Aug 6, 2022
1 parent d25ff1f commit 4703c15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/test/test_grp.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ def test_values_extended(self):

def test_errors(self):
self.assertRaises(TypeError, grp.getgrgid)
self.assertRaises(TypeError, grp.getgrgid, 3.14)
self.assertRaises(TypeError, grp.getgrnam)
self.assertRaises(TypeError, grp.getgrnam, 42)
self.assertRaises(TypeError, grp.getgrall, 42)
# embedded null character
self.assertRaises(ValueError, grp.getgrnam, 'a\x00b')
self.assertRaisesRegex(ValueError, 'null', grp.getgrnam, 'a\x00b')

# try to get some errors
bynames = {}
Expand Down

0 comments on commit 4703c15

Please sign in to comment.