summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-08-03 08:07:18 +0000
committerRonald Oussoren <ronaldoussoren@mac.com>2010-08-03 08:07:18 +0000
commitbb4d9f6c3d15e70df415fb9661de1a8fb8542b81 (patch)
tree55b1d3c1a1146834c175c6f509cfbe4aeeae0090
parente511c6ce8d5c21f279df0b5c8b74ba2dcda67b21 (diff)
downloadcpython-git-bb4d9f6c3d15e70df415fb9661de1a8fb8542b81.tar.gz
Merged revisions 83643 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint ................ r83643 | ronald.oussoren | 2010-08-03 09:31:12 +0200 (Tue, 03 Aug 2010) | 13 lines Merged revisions 83431 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83431 | ronald.oussoren | 2010-08-01 21:18:13 +0200 (Sun, 01 Aug 2010) | 6 lines test_getgroups as introduced with issue7900 failed on systems where 'id -G' and posix.getgroups() returned the same information, but one of the sources contains duplicate information. Rewrite the check using sets instead of lists. ........ ................
-rw-r--r--Lib/test/test_posix.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 195df2654c..fb830ae9ec 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -315,11 +315,11 @@ class PosixTester(unittest.TestCase):
# This test needs 'id -G'
return
- # The order of groups isn't important, hence the calls
- # to sorted.
+ # 'id -G' and 'os.getgroups()' should return the same
+ # groups, ignoring order and duplicates.
self.assertEqual(
- list(sorted([int(x) for x in groups.split()])),
- list(sorted(posix.getgroups())))
+ set([int(x) for x in groups.split()]),
+ set(posix.getgroups()))
class PosixGroupsTester(unittest.TestCase):
if posix.getuid() == 0 and hasattr(posix, 'getgroups') and sys.platform != 'darwin':