[Python-checkins] r83447 - in python/branches/release31-maint: Lib/test/test_posix.py
georg.brandl
python-checkins at python.org
Sun Aug 1 22:55:37 CEST 2010
Author: georg.brandl
Date: Sun Aug 1 22:55:37 2010
New Revision: 83447
Log:
Merged revisions 83431 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k
........
r83431 | ronald.oussoren | 2010-08-01 21:18:13 +0200 (So, 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.
........
Modified:
python/branches/release31-maint/ (props changed)
python/branches/release31-maint/Lib/test/test_posix.py
Modified: python/branches/release31-maint/Lib/test/test_posix.py
==============================================================================
--- python/branches/release31-maint/Lib/test/test_posix.py (original)
+++ python/branches/release31-maint/Lib/test/test_posix.py Sun Aug 1 22:55:37 2010
@@ -281,11 +281,11 @@
if not groups:
raise unittest.SkipTest("need working 'id -G'")
- # 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):
More information about the Python-checkins
mailing list