From: Antoine Pitrou Date: Sat, 4 Sep 2010 17:34:12 +0000 (+0000) Subject: Merged revisions 84492 via svnmerge from X-Git-Tag: v2.7.1rc1~341 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd806cef090256f88dfe0ad88bdcba200be4cb78;p=python Merged revisions 84492 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84492 | antoine.pitrou | 2010-09-04 19:32:06 +0200 (sam., 04 sept. 2010) | 4 lines Issue #9581: Fix non-working PosixGroupsTester test case (it only runs as root, which is why nobody bothered about the failure) ........ --- diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index e7d008472f..1119142ba7 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -400,13 +400,7 @@ class PosixGroupsTester(unittest.TestCase): def test_initgroups(self): # find missing group - groups = sorted(self.saved_groups) - for g1,g2 in zip(groups[:-1], groups[1:]): - g = g1 + 1 - if g < g2: - break - else: - g = g2 + 1 + g = max(self.saved_groups) + 1 name = pwd.getpwuid(posix.getuid()).pw_name posix.initgroups(name, g) self.assertIn(g, posix.getgroups())