Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
04e9a7c4
Commit
04e9a7c4
authored
Dec 13, 2012
by
Ross Lagerwall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #16661: Fix the os.getgrouplist() test by not assuming that it
gives the same output as "id -G".
parent
089081f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
Lib/test/test_posix.py
Lib/test/test_posix.py
+3
-10
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_posix.py
View file @
04e9a7c4
...
...
@@ -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
:
groups
=
idg
.
read
().
strip
()
ret
=
idg
.
close
(
)
user
=
pwd
.
getpwuid
(
os
.
getuid
())[
0
]
group
=
pwd
.
getpwuid
(
os
.
getuid
())[
3
]
self
.
assertIn
(
group
,
posix
.
getgrouplist
(
user
,
group
)
)
if
ret
is
not
None
or
not
groups
:
raise
unittest
.
SkipTest
(
"need working 'id -G'"
)
self
.
assertEqual
(
set
([
int
(
x
)
for
x
in
groups
.
split
()]),
set
(
posix
.
getgrouplist
(
pwd
.
getpwuid
(
os
.
getuid
())[
0
],
pwd
.
getpwuid
(
os
.
getuid
())[
3
])))
@
unittest
.
skipUnless
(
hasattr
(
os
,
'getegid'
),
"test needs os.getegid()"
)
def
test_getgroups
(
self
):
...
...
Misc/NEWS
View file @
04e9a7c4
...
...
@@ -301,6 +301,9 @@ Tests
-
Issue
#
16559
:
Add
more
tests
for
the
json
module
,
including
some
from
the
official
test
suite
at
json
.
org
.
Patch
by
Serhiy
Storchaka
.
-
Issue
#
16661
:
Fix
the
`
os
.
getgrouplist
()`
test
by
not
assuming
that
it
gives
the
same
output
as
:
command
:`
id
-
G
`.
-
Issue
#
16115
:
Add
some
tests
for
the
executable
argument
to
subprocess
.
Popen
().
Initial
patch
by
Kushal
Das
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment