Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update test_grp.py from Cpython v3.11.2 #4833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update test_grp.py from Cpython v3.11.2
  • Loading branch information
Masorubka1 authored and youknowone committed Apr 5, 2023
commit 5e84692e7e4a92558563e7b60a5718eb3f518e4e
6 changes: 4 additions & 2 deletions 6 Lib/test/test_grp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


grp = import_helper.import_module('grp')
@unittest.skipUnless(hasattr(grp, 'getgrall'), 'Does not have getgrall()')

class GroupDatabaseTestCase(unittest.TestCase):

def check_value(self, value):
Expand Down 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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.