mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
by Ross Lagerwall.
This commit is contained in:
parent
287d1fdd3f
commit
318b8f35fe
2 changed files with 7 additions and 1 deletions
|
@ -373,6 +373,7 @@ class PosixTester(unittest.TestCase):
|
||||||
os.chdir(curdir)
|
os.chdir(curdir)
|
||||||
support.rmtree(base_path)
|
support.rmtree(base_path)
|
||||||
|
|
||||||
|
@unittest.skipUnless(hasattr(os, 'getegid'), "test needs os.getegid()")
|
||||||
def test_getgroups(self):
|
def test_getgroups(self):
|
||||||
with os.popen('id -G') as idg:
|
with os.popen('id -G') as idg:
|
||||||
groups = idg.read().strip()
|
groups = idg.read().strip()
|
||||||
|
@ -382,9 +383,11 @@ class PosixTester(unittest.TestCase):
|
||||||
|
|
||||||
# 'id -G' and 'os.getgroups()' should return the same
|
# 'id -G' and 'os.getgroups()' should return the same
|
||||||
# groups, ignoring order and duplicates.
|
# groups, ignoring order and duplicates.
|
||||||
|
# #10822 - it is implementation defined whether posix.getgroups()
|
||||||
|
# includes the effective gid so we include it anyway, since id -G does
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
set([int(x) for x in groups.split()]),
|
set([int(x) for x in groups.split()]),
|
||||||
set(posix.getgroups()))
|
set(posix.getgroups() + [posix.getegid()]))
|
||||||
|
|
||||||
class PosixGroupsTester(unittest.TestCase):
|
class PosixGroupsTester(unittest.TestCase):
|
||||||
|
|
||||||
|
|
|
@ -223,6 +223,9 @@ Tools/Demos
|
||||||
Tests
|
Tests
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
|
||||||
|
by Ross Lagerwall.
|
||||||
|
|
||||||
- Make the --coverage flag work for test.regrtest.
|
- Make the --coverage flag work for test.regrtest.
|
||||||
|
|
||||||
- Issue #1677694: Refactor and improve test_timeout. Original patch by
|
- Issue #1677694: Refactor and improve test_timeout. Original patch by
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue