]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 87958 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 12 Jan 2011 18:56:09 +0000 (18:56 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 12 Jan 2011 18:56:09 +0000 (18:56 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87958 | antoine.pitrou | 2011-01-12 19:45:27 +0100 (mer., 12 janv. 2011) | 4 lines

  Issue #10822: Fix test_posix:test_getgroups failure under Solaris.  Patch
  by Ross Lagerwall.
........

Lib/test/test_posix.py
Misc/NEWS

index e2ef2cfaf4e715c9719956ee4167ba616a081d4d..a5db21eefbd7de7396ecc9ce377a4f7e6e049493 100644 (file)
@@ -370,6 +370,7 @@ class PosixTester(unittest.TestCase):
                 os.chdir(curdir)
                 shutil.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()
@@ -379,9 +380,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):
 
index 95e31b944a2d5f5c84d10b3fef2672005eccc4c7..2f17900184cdf9bcf896c71ca5cd7548571a3cbe 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -146,6 +146,9 @@ Build
 Tests
 -----
 
+- Issue #10822: Fix test_posix:test_getgroups failure under Solaris.  Patch
+  by Ross Lagerwall.
+
 - Issue #6293: Have regrtest.py echo back sys.flags.  This is done by default
   in whole runs and enabled selectively using ``--header`` when running an
   explicit list of tests.  Original patch by Collin Winter.