summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-07-24 14:19:26 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2010-07-24 14:19:26 (GMT)
commit55b9da588552c0a3d892a3e9f82db108e4d542bf (patch)
treed25871a0f8d556fbd7a819e61bcae61f32493b1a
parent1135a1732fe1aa3c3164fbaa6fcc25bc2f6367be (diff)
downloadcpython-55b9da588552c0a3d892a3e9f82db108e4d542bf.zip
cpython-55b9da588552c0a3d892a3e9f82db108e4d542bf.tar.gz
cpython-55b9da588552c0a3d892a3e9f82db108e4d542bf.tar.bz2
Merged revisions 83133 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83133 | ronald.oussoren | 2010-07-24 15:15:19 +0100 (Sat, 24 Jul 2010) | 5 lines Fix for issue 9367: the test code for os.getgroups assumes that the result of getgroups and the output of the id(1) command return groups in the same order. That assumption is both fragile and false. ........
-rw-r--r--Lib/test/test_posix.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 31459ff..a830c36 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -281,7 +281,11 @@ class PosixTester(unittest.TestCase):
if not groups:
raise unittest.SkipTest("need working 'id -G'")
- self.assertEqual([int(x) for x in groups.split()], posix.getgroups())
+ # The order of groups isn't important, hence the calls
+ # to sorted.
+ self.assertEqual(
+ list(sorted([int(x) for x in groups.split()])),
+ list(sorted(posix.getgroups())))
class PosixGroupsTester(unittest.TestCase):