Skip to content

Commit 715dba4

Browse files
committed
Run cygpath tests on Cygwin, not native Windows
They were not running on Cygwin, because git.util.is_win is False on Cygwin. They were running on native Windows, with a number of them always failing; these failures had sometimes been obscured by the --maxfail=10 that had formerly been used (from pyproject.toml). Many of them (not all the same ones) fail on Cygwin, and it might be valuable for cygpath to work on other platforms, especially native Windows. But I think it still makes sense to limit the tests to Cygwin at this time, because all the uses of cygpath in the project are in code that only runs after a check that the platform is Cygwin. Part of that check, as it is implemented, explicitly excludes native Windows (is_win must be false).
1 parent 0eb38bc commit 715dba4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: test/test_util.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import sys
1010
import tempfile
1111
import time
12-
from unittest import mock, skipIf
12+
from unittest import mock, skipUnless
1313
from datetime import datetime
1414

1515
import ddt
@@ -84,14 +84,14 @@ def setup(self):
8484
"array": [42],
8585
}
8686

87-
@skipIf(not is_win, "Paths specifically for Windows.")
87+
@skipUnless(sys.platform == "cygwin", "Paths specifically for Cygwin.")
8888
@ddt.idata(_norm_cygpath_pairs + _unc_cygpath_pairs)
8989
def test_cygpath_ok(self, case):
9090
wpath, cpath = case
9191
cwpath = cygpath(wpath)
9292
self.assertEqual(cwpath, cpath, wpath)
9393

94-
@skipIf(not is_win, "Paths specifically for Windows.")
94+
@skipUnless(sys.platform == "cygwin", "Paths specifically for Cygwin.")
9595
@ddt.data(
9696
(r"./bar", "bar"),
9797
(r".\bar", "bar"),
@@ -104,7 +104,7 @@ def test_cygpath_norm_ok(self, case):
104104
cwpath = cygpath(wpath)
105105
self.assertEqual(cwpath, cpath or wpath, wpath)
106106

107-
@skipIf(not is_win, "Paths specifically for Windows.")
107+
@skipUnless(sys.platform == "cygwin", "Paths specifically for Cygwin.")
108108
@ddt.data(
109109
r"C:",
110110
r"C:Relative",
@@ -117,7 +117,7 @@ def test_cygpath_invalids(self, wpath):
117117
cwpath = cygpath(wpath)
118118
self.assertEqual(cwpath, wpath.replace("\\", "/"), wpath)
119119

120-
@skipIf(not is_win, "Paths specifically for Windows.")
120+
@skipUnless(sys.platform == "cygwin", "Paths specifically for Cygwin.")
121121
@ddt.idata(_norm_cygpath_pairs)
122122
def test_decygpath(self, case):
123123
wpath, cpath = case

0 commit comments

Comments
 (0)