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

Commit5f86515

Browse files
authored
Merge pull request#1749 from EliahKagan/rmtree-lchmod
Document some minor subtleties in test_util.py
2 parents5c6a4f4 +2fabe71 commit5f86515

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎test/test_util.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ def _patch_for_wrapping_test(self, mocker, hide_windows_known_errors):
140140
# git.index.util "replaces" git.util and is what "import git.util" gives us.
141141
mocker.patch.object(sys.modules["git.util"],"HIDE_WINDOWS_KNOWN_ERRORS",hide_windows_known_errors)
142142

143-
# Disable common chmod functions so the callback can't fix a PermissionError.
143+
# Mock out common chmod functions to simulate PermissionError the callback can't
144+
# fix. (We leave the corresponding lchmod functions alone. If they're used, it's
145+
# more important we detect any failures from inadequate compatibility checks.)
144146
mocker.patch.object(os,"chmod")
145147
mocker.patch.object(pathlib.Path,"chmod")
146148

@@ -256,14 +258,15 @@ def _xfail_param(*values, **xfail_kwargs):
256258
(R"D:/Apps\fOO","/cygdrive/d/Apps/fOO"),
257259
(R"D:\Apps/123","/cygdrive/d/Apps/123"),
258260
)
261+
"""Path test cases for cygpath and decygpath, other than extended UNC paths."""
259262

260263
_unc_cygpath_pairs= (
261264
(R"\\?\a:\com","/cygdrive/a/com"),
262265
(R"\\?\a:/com","/cygdrive/a/com"),
263266
(R"\\?\UNC\server\D$\Apps","//server/D$/Apps"),
264267
)
268+
"""Extended UNC path test cases for cygpath."""
265269

266-
# Mapping of expected failures for the test_cygpath_ok test.
267270
_cygpath_ok_xfails= {
268271
# From _norm_cygpath_pairs:
269272
(R"C:\Users","/cygdrive/c/Users"):"/proc/cygdrive/c/Users",
@@ -277,9 +280,9 @@ def _xfail_param(*values, **xfail_kwargs):
277280
(R"\\?\a:\com","/cygdrive/a/com"):"/proc/cygdrive/a/com",
278281
(R"\\?\a:/com","/cygdrive/a/com"):"/proc/cygdrive/a/com",
279282
}
283+
"""Mapping of expected failures for the test_cygpath_ok test."""
280284

281285

282-
# Parameter sets for the test_cygpath_ok test.
283286
_cygpath_ok_params= [
284287
(
285288
_xfail_param(*case,reason=f"Returns:{_cygpath_ok_xfails[case]!r}",raises=AssertionError)
@@ -288,6 +291,7 @@ def _xfail_param(*values, **xfail_kwargs):
288291
)
289292
forcasein_norm_cygpath_pairs+_unc_cygpath_pairs
290293
]
294+
"""Parameter sets for the test_cygpath_ok test."""
291295

292296

293297
@pytest.mark.skipif(sys.platform!="cygwin",reason="Paths specifically for Cygwin.")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp