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

Commit487bc8a

Browse files
committed
Start making TestCygpath xfail markings granular
This marks only the one really expected failure case inin test_cygpath_norm_ok as xfail, preventing the others fromgiving "XPASS" results each time the tests are run.
1 parent1dccb8e commit487bc8a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎test/test_util.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ def test_env_vars_for_windows_tests(self, name, env_var_value, expected_truth_va
211211
assertactual_parsed_valueisexpected_truth_value
212212

213213

214+
def_xfail_param(*values,**xfail_kwargs):
215+
"""Build a pytest.mark.parametrize parameter that carries an xfail mark."""
216+
returnpytest.param(*values,marks=pytest.mark.xfail(**xfail_kwargs))
217+
218+
214219
@pytest.mark.skipif(sys.platform!="cygwin",reason="Paths specifically for Cygwin.")
215220
classTestCygpath:
216221
"""Tests for :func:`git.util.cygpath` and :func:`git.util.decygpath`."""
@@ -246,15 +251,11 @@ def test_cygpath_ok(self, wpath, cpath):
246251
cwpath=cygpath(wpath)
247252
assertcwpath==cpath,wpath
248253

249-
@pytest.mark.xfail(
250-
reason=R'2nd example r".\bar" -> "bar" fails, returns "./bar"',
251-
raises=AssertionError,
252-
)
253254
@pytest.mark.parametrize(
254255
"wpath, cpath",
255256
[
256257
(R"./bar","bar"),
257-
(R".\bar","bar"),# FIXME: Mark only this one xfail (or fix it).
258+
_xfail_param(R".\bar","bar",reason=R'Returns: "./bar"',raises=AssertionError),
258259
(R"../bar","../bar"),
259260
(R"..\bar","../bar"),
260261
(R"../bar/.\foo/../chu","../bar/chu"),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp