Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitba5bc45

Browse files
committed
Better explain the Windows and Unix cases
Of PermissionError, in the rmtree tests.
1 parent7d98f94 commitba5bc45

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎test/test_util.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ def permission_error_tmpdir(tmp_path):
4949
td=tmp_path/"testdir"
5050
td.mkdir()
5151
(td/"x").write_bytes(b"")
52-
(td/"x").chmod(stat.S_IRUSR)# Set up PermissionError on Windows.
53-
td.chmod(stat.S_IRUSR|stat.S_IXUSR)# Set up PermissionError on Unix.
52+
53+
# Set up PermissionError on Windows, where we can't delete read-only files.
54+
(td/"x").chmod(stat.S_IRUSR)
55+
56+
# Set up PermissionError on Unix, where we can't delete files in read-only directories.
57+
td.chmod(stat.S_IRUSR|stat.S_IXUSR)
58+
5459
yieldtd
5560

5661

@@ -113,7 +118,7 @@ def test_wraps_perm_error_if_enabled(self, mocker, permission_error_tmpdir):
113118
# git.index.util "replaces" git.util and is what "import git.util" gives us.
114119
mocker.patch.object(sys.modules["git.util"],"HIDE_WINDOWS_KNOWN_ERRORS",True)
115120

116-
# Disable common chmod functions so the callback can't fix the problem.
121+
# Disable common chmod functions so the callback can never fix the problem.
117122
mocker.patch.object(os,"chmod")
118123
mocker.patch.object(pathlib.Path,"chmod")
119124

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp