[3.12] gh-113090: Fix test.support.os_support.can_chmod() on Windows (GH-113091) by miss-islington · Pull Request #113099 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Lib/test/support/os_helper.py
2 changes: 1 addition & 1 deletion Lib/test/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ def tearDown(self):
os.removedirs(path)


@os_helper.skip_unless_working_chmod
@unittest.skipUnless(hasattr(os, "chown"), "requires os.chown()")
class ChownFileTests(unittest.TestCase):

@classmethod
Expand Down
4 changes: 3 additions & 1 deletion Lib/test/test_posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ def check_stat(uid, gid):
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
Expand Down Expand Up @@ -956,6 +956,7 @@ def check_chmod(self, chmod_func, target, **kwargs):
finally:
posix.chmod(target, mode)

@os_helper.skip_unless_working_chmod
def test_chmod_file(self):
self.check_chmod(posix.chmod, os_helper.TESTFN)

Expand All @@ -965,6 +966,7 @@ def tempdir(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_tarfile.py