gh-90473: Make chmod a dummy on WASI, skip chmod tests (GH-93534)

WASI does not have the ``chmod(2)`` syscall yet.
This commit is contained in:
Christian Heimes 2022-06-06 19:24:11 +02:00 committed by GitHub
parent 56b5daf159
commit 22fed605e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 81 additions and 5 deletions

View file

@ -1670,7 +1670,7 @@ class MakedirTests(unittest.TestCase):
os.removedirs(path)
@unittest.skipUnless(hasattr(os, 'chown'), "Test needs chown")
@os_helper.skip_unless_working_chmod
class ChownFileTests(unittest.TestCase):
@classmethod
@ -3784,7 +3784,6 @@ class OSErrorTests(unittest.TestCase):
def test_oserror_filename(self):
funcs = [
(self.filenames, os.chdir,),
(self.filenames, os.chmod, 0o777),
(self.filenames, os.lstat,),
(self.filenames, os.open, os.O_RDONLY),
(self.filenames, os.rmdir,),
@ -3805,6 +3804,8 @@ class OSErrorTests(unittest.TestCase):
(self.filenames, os.rename, "dst"),
(self.filenames, os.replace, "dst"),
))
if os_helper.can_chmod():
funcs.append((self.filenames, os.chmod, 0o777))
if hasattr(os, "chown"):
funcs.append((self.filenames, os.chown, 0, 0))
if hasattr(os, "lchown"):