]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-95395: Add argument type error test (GH-95412) (GH-95745)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 6 Aug 2022 17:30:29 +0000 (10:30 -0700)
committerGitHub <noreply@github.com>
Sat, 6 Aug 2022 17:30:29 +0000 (19:30 +0200)
(cherry picked from commit 4703c158116bd157e20938bbf5356b79422470bb)

Co-authored-by: Sion Kang <31057849+Yaminyam@users.noreply.github.com>
Lib/test/test_grp.py

index c7ec03ec0e4388431267d206de89cad6260f91a7..e52e17b8dc73667bcf6b5f09194fdb74cb611b36 100644 (file)
@@ -49,10 +49,12 @@ class GroupDatabaseTestCase(unittest.TestCase):
 
     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 = {}