@@ -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 for case in _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