Skip to content

Commit

Permalink
Further document cygpath test parameter collections
Browse files Browse the repository at this point in the history
  • Loading branch information
EliahKagan committed Nov 29, 2023
1 parent a09e538 commit 2fabe71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,15 @@ def _xfail_param(*values, **xfail_kwargs):
(R"D:/Apps\fOO", "/cygdrive/d/Apps/fOO"),
(R"D:\Apps/123", "/cygdrive/d/Apps/123"),
)
"""Path test cases for cygpath and decygpath, other than extended UNC paths."""

_unc_cygpath_pairs = (
(R"\\?\a:\com", "/cygdrive/a/com"),
(R"\\?\a:/com", "/cygdrive/a/com"),
(R"\\?\UNC\server\D$\Apps", "//server/D$/Apps"),
)
"""Extended UNC path test cases for cygpath."""

# Mapping of expected failures for the test_cygpath_ok test.
_cygpath_ok_xfails = {
# From _norm_cygpath_pairs:
(R"C:\Users", "/cygdrive/c/Users"): "/proc/cygdrive/c/Users",
Expand All @@ -279,9 +280,9 @@ def _xfail_param(*values, **xfail_kwargs):
(R"\\?\a:\com", "/cygdrive/a/com"): "/proc/cygdrive/a/com",
(R"\\?\a:/com", "/cygdrive/a/com"): "/proc/cygdrive/a/com",
}
"""Mapping of expected failures for the test_cygpath_ok test."""


# Parameter sets for the test_cygpath_ok test.
_cygpath_ok_params = [
(
_xfail_param(*case, reason=f"Returns: {_cygpath_ok_xfails[case]!r}", raises=AssertionError)
Expand All @@ -290,6 +291,7 @@ def _xfail_param(*values, **xfail_kwargs):
)
for case in _norm_cygpath_pairs + _unc_cygpath_pairs
]
"""Parameter sets for the test_cygpath_ok test."""


@pytest.mark.skipif(sys.platform != "cygwin", reason="Paths specifically for Cygwin.")
Expand Down

0 comments on commit 2fabe71

Please sign in to comment.