gh-113090: Fix test.support.os_support.can_chmod() on Windows (GH-113091)

This commit is contained in:
Serhiy Storchaka 2023-12-14 13:27:43 +02:00 committed by GitHub
parent 23a5711100
commit c6e953be12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View file

@ -791,7 +791,7 @@ class PosixTester(unittest.TestCase):
self.assertRaises(TypeError, chown_func, first_param, uid, t(gid))
check_stat(uid, gid)
@os_helper.skip_unless_working_chmod
@unittest.skipUnless(hasattr(os, "chown"), "requires os.chown()")
@unittest.skipIf(support.is_emscripten, "getgid() is a stub")
def test_chown(self):
# raise an OSError if the file does not exist
@ -956,6 +956,7 @@ class PosixTester(unittest.TestCase):
finally:
posix.chmod(target, mode)
@os_helper.skip_unless_working_chmod
def test_chmod_file(self):
self.check_chmod(posix.chmod, os_helper.TESTFN)
@ -965,6 +966,7 @@ class PosixTester(unittest.TestCase):
self.addCleanup(posix.rmdir, target)
return target
@os_helper.skip_unless_working_chmod
def test_chmod_dir(self):
target = self.tempdir()
self.check_chmod(posix.chmod, target)