Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3ccde8 commit e5a9101Copy full SHA for e5a9101
1 file changed
Lib/test/test_posix.py
@@ -409,21 +409,15 @@ def tearDown(self):
409
def test_initgroups(self):
410
# find missing group
411
412
- groups = sorted(self.saved_groups)
413
- for g1,g2 in zip(groups[:-1], groups[1:]):
414
- g = g1 + 1
415
- if g < g2:
416
- break
417
- else:
418
- g = g2 + 1
+ g = max(self.saved_groups) + 1
419
name = pwd.getpwuid(posix.getuid()).pw_name
420
posix.initgroups(name, g)
421
self.assertIn(g, posix.getgroups())
422
423
@unittest.skipUnless(hasattr(posix, 'setgroups'),
424
"test needs posix.setgroups()")
425
def test_setgroups(self):
426
- for groups in [[0], range(16)]:
+ for groups in [[0], list(range(16))]:
427
posix.setgroups(groups)
428
self.assertListEqual(groups, posix.getgroups())
429
0 commit comments