Skip to content

Commit

Permalink
Run cygpath tests on Cygwin, not native Windows
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
EliahKagan committed Sep 15, 2023
1 parent bde29d0 commit 71234ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import sys
import tempfile
import time
from unittest import mock, skipIf
from unittest import mock, skipUnless
from datetime import datetime

import ddt
Expand Down Expand Up @@ -84,14 +84,14 @@ def setup(self):
"array": [42],
}

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

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

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

@skipIf(not is_win, "Paths specifically for Windows.")
@skipUnless(sys.platform == "cygwin", "Paths specifically for Cygwin.")
@ddt.idata(_norm_cygpath_pairs)
def test_decygpath(self, case):
wpath, cpath = case
Expand Down

0 comments on commit 71234ca

Please sign in to comment.