summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 4416f68..4c0d53a 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -314,7 +314,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):
if posix.getuid() == 0 and hasattr(posix, 'getgroups') and sys.platform != 'darwin':