summaryrefslogtreecommitdiff
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-01-12 18:45:27 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2011-01-12 18:45:27 +0000
commit318b8f35fe6c56c2c2792192ccdeb2b47eff81e4 (patch)
treecc2082f69729d12a472d0a1bf2fa27b3479b41d8 /Lib/test/test_posix.py
parent287d1fdd3fc3d2c9dfa88be69e2ee0a8ae7e5928 (diff)
downloadcpython-git-318b8f35fe6c56c2c2792192ccdeb2b47eff81e4.tar.gz
Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
by Ross Lagerwall.
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index f9f9fcec6a..45b3afc72d 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -373,6 +373,7 @@ class PosixTester(unittest.TestCase):
os.chdir(curdir)
support.rmtree(base_path)
+ @unittest.skipUnless(hasattr(os, 'getegid'), "test needs os.getegid()")
def test_getgroups(self):
with os.popen('id -G') as idg:
groups = idg.read().strip()
@@ -382,9 +383,11 @@ class PosixTester(unittest.TestCase):
# 'id -G' and 'os.getgroups()' should return the same
# groups, ignoring order and duplicates.
+ # #10822 - it is implementation defined whether posix.getgroups()
+ # includes the effective gid so we include it anyway, since id -G does
self.assertEqual(
set([int(x) for x in groups.split()]),
- set(posix.getgroups()))
+ set(posix.getgroups() + [posix.getegid()]))
class PosixGroupsTester(unittest.TestCase):