Skip to content

Commit d6a2d28

Browse files
committed
Mark some cygpath tests xfail
Two of the groups of cygpath tests in test_util.py generate tests that fail on Cygwin. There is no easy way to still run, but xfail, just the specific tests that fail, because the groups of tests are generated with `@ddt` parameterization, but neither the unittest nor pytest xfail mechanisms interact with that. If `@pytest.mark.parametrized` were used, this could be done. But that does not work on methods of test classes that derive from unittest.TestCase, including those in this project that indirectly derive from it by deriving from TestBase. The TestBase base class cannot be removed without overhauling many tests, due to fixtures it provides such as rorepo. So this marks too many tests as xfail, but in doing so allows test runs to pass while still exercising and showing status on all the tests, allowing result changes to be observed easily.
1 parent 715dba4 commit d6a2d28

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: test/test_util.py

+9
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from datetime import datetime
1414

1515
import ddt
16+
import pytest
1617

1718
from git.cmd import dashify
1819
from git.compat import is_win
@@ -84,13 +85,21 @@ def setup(self):
8485
"array": [42],
8586
}
8687

88+
@pytest.mark.xfail(
89+
reason="Many return paths prefixed /proc/cygdrive instead.",
90+
raises=AssertionError,
91+
)
8792
@skipUnless(sys.platform == "cygwin", "Paths specifically for Cygwin.")
8893
@ddt.idata(_norm_cygpath_pairs + _unc_cygpath_pairs)
8994
def test_cygpath_ok(self, case):
9095
wpath, cpath = case
9196
cwpath = cygpath(wpath)
9297
self.assertEqual(cwpath, cpath, wpath)
9398

99+
@pytest.mark.xfail(
100+
reason=r'2nd example r".\bar" -> "bar" fails, returns "./bar"',
101+
raises=AssertionError,
102+
)
94103
@skipUnless(sys.platform == "cygwin", "Paths specifically for Cygwin.")
95104
@ddt.data(
96105
(r"./bar", "bar"),

0 commit comments

Comments
 (0)