Skip to content

Commit ec921ea

Browse files
committed
bpo-40014: Apply Victors's code review.
1 parent cd8fc55 commit ec921ea

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎Lib/test/test_posix.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,8 +1027,13 @@ def test_getgrouplist(self):
10271027
group = pwd.getpwuid(os.getuid())[3]
10281028
try:
10291029
self.assertIn(group, posix.getgrouplist(user, group))
1030-
except OSError:
1031-
raise unittest.SkipTest("os.getgrouplist() is not available")
1030+
except OSError as e:
1031+
# bpo-40014: getgrouplist fails with
1032+
# "[Errno 25] Inappropriate ioctl for device" on macOS
1033+
if sys.platform == 'darwin':
1034+
raise unittest.SkipTest("bpo-40014: os.getgrouplist() is not available")
1035+
else:
1036+
raise e
10321037

10331038
@unittest.skipUnless(hasattr(os, 'getegid'), "test needs os.getegid()")
10341039
def test_getgroups(self):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Skip :func:`~os.getgrouplist` related tests, if :exc:`OSError` is raised.
1+
test.pythoninfo: skip :func:`~os.getgrouplist` if it raises an :exc:`OSError`.
22
Patch by Dong-hee Na.

0 commit comments

Comments
 (0)