cpython: 05a37954a30c (original) (raw)
Mercurial > cpython
changeset 80839:05a37954a30c
Merge with 3.3 for #16661 [#16661]
Ross Lagerwall rosslagerwall@gmail.com | |
---|---|
date | Thu, 13 Dec 2012 15:21:16 +0000 |
parents | 5435a9278028(current diff)ce85fe971e0a(diff) |
children | 9347869d1066 |
files | Misc/NEWS |
diffstat | 2 files changed, 6 insertions(+), 10 deletions(-)[+] [-] Lib/test/test_posix.py 13 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -647,17 +647,10 @@ class PosixTester(unittest.TestCase): @unittest.skipUnless(hasattr(pwd, 'getpwuid'), "test needs pwd.getpwuid()") @unittest.skipUnless(hasattr(os, 'getuid'), "test needs os.getuid()") def test_getgrouplist(self):
with os.popen('id -G') as idg:[](#l1.7)
groups = idg.read().strip()[](#l1.8)
ret = idg.close()[](#l1.9)
user = pwd.getpwuid(os.getuid())[0][](#l1.10)
group = pwd.getpwuid(os.getuid())[3][](#l1.11)
self.assertIn(group, posix.getgrouplist(user, group))[](#l1.12)
if ret is not None or not groups:[](#l1.14)
raise unittest.SkipTest("need working 'id -G'")[](#l1.15)
self.assertEqual([](#l1.17)
set([int(x) for x in groups.split()]),[](#l1.18)
set(posix.getgrouplist(pwd.getpwuid(os.getuid())[0],[](#l1.19)
pwd.getpwuid(os.getuid())[3])))[](#l1.20)
@unittest.skipUnless(hasattr(os, 'getegid'), "test needs os.getegid()") def test_getgroups(self):