summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-20 17:48:22 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-20 17:48:22 (GMT)
commitb3d62cefc781c396754f93c98e837fb073755333 (patch)
tree6987ada0eecd86080d3cc942cbb20db51a27b2a5
parent54db2fd5d0a3383a26135ff5afade302753bce28 (diff)
downloadcpython-b3d62cefc781c396754f93c98e837fb073755333.zip
cpython-b3d62cefc781c396754f93c98e837fb073755333.tar.gz
cpython-b3d62cefc781c396754f93c98e837fb073755333.tar.bz2
Issue #17248: Fix os.*chown() testing when user has group root.
-rw-r--r--Lib/test/test_posix.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index e06ffa5..5a26d64 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -279,10 +279,11 @@ class PosixTester(unittest.TestCase):
# non-root cannot chown to root, raises OSError
self.assertRaises(OSError, chown_func, first_param, 0, 0)
check_stat(uid, gid)
- self.assertRaises(OSError, chown_func, first_param, -1, 0)
- check_stat(uid, gid)
self.assertRaises(OSError, chown_func, first_param, 0, -1)
check_stat(uid, gid)
+ if gid != 0:
+ self.assertRaises(OSError, chown_func, first_param, -1, 0)
+ check_stat(uid, gid)
# test illegal types
for t in str, float:
self.assertRaises(TypeError, chown_func, first_param, t(uid), gid)