Skip to content

Commit

Permalink
Mark failing tests on Windows + Py3.13 as xfail
Browse files Browse the repository at this point in the history
This test should start passing when 3.13.0a2 is released, so the xfail
set to strict=True will start causing the CI to error at the time. We'll
remove the marker.
  • Loading branch information
uranusjr committed Jun 19, 2024
1 parent d94806f commit 596be04
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
18 changes: 16 additions & 2 deletions tests/unit/test_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,14 @@ def test_clean_url_path_with_local_path(path: str, expected: str) -> None:
pytest.param(
"file:https:///T:/path/with spaces/",
"file:https:///T:/path/with%20spaces",
marks=pytest.mark.skipif("sys.platform != 'win32'"),
marks=[
pytest.mark.skipif("sys.platform != 'win32'"),
pytest.mark.xfail(
reason="Failing in Python 3.13.0a1, fixed in python/cpython#113563",
condition="sys.version_info >= (3, 13)",
strict=True,
),
],
),
# URL with Windows drive letter, running on non-windows
# platform. The `:` after the drive should be quoted.
Expand All @@ -396,7 +403,14 @@ def test_clean_url_path_with_local_path(path: str, expected: str) -> None:
pytest.param(
"git+file:https:///T:/with space/[email protected]#egg=my-package-1.0",
"git+file:https:///T:/with%20space/[email protected]#egg=my-package-1.0",
marks=pytest.mark.skipif("sys.platform != 'win32'"),
marks=[
pytest.mark.skipif("sys.platform != 'win32'"),
pytest.mark.xfail(
reason="Failing in Python 3.13.0a1, fixed in python/cpython#113563",
condition="sys.version_info >= (3, 13)",
strict=True,
),
],
),
# Test a VCS URL with a Windows drive letter and revision,
# running on non-windows platform.
Expand Down
31 changes: 25 additions & 6 deletions tests/unit/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,31 @@ def test_path_to_url_unix() -> None:


@pytest.mark.skipif("sys.platform != 'win32'")
def test_path_to_url_win() -> None:
assert path_to_url("c:/tmp/file") == "file:https:///C:/tmp/file"
assert path_to_url("c:\\tmp\\file") == "file:https:///C:/tmp/file"
assert path_to_url(r"\\unc\as\path") == "file:https://unc/as/path"
path = os.path.join(os.getcwd(), "file")
assert path_to_url("file") == "file:" + urllib.request.pathname2url(path)
@pytest.mark.parametrize(
"path, url",
[
pytest.param("c:/tmp/file", "file:https:///C:/tmp/file", id="posix-path"),
pytest.param("c:\\tmp\\file", "file:https:///C:/tmp/file", id="nt-path"),
pytest.param(
r"\\unc\as\path",
"file:https://unc/as/path",
marks=pytest.mark.xfail(
reason="Failing in Python 3.13.0a1, fixed in python/cpython#113563",
condition="sys.version_info >= (3, 13)",
strict=True,
),
id="unc-path",
),
],
)
def test_path_to_url_win(path: str, url: str) -> None:
assert path_to_url(path) == url


@pytest.mark.skipif("sys.platform != 'win32'")
def test_relative_path_to_url_win() -> None:
resolved_path = os.path.join(os.getcwd(), "file")
assert path_to_url("file") == "file:" + urllib.request.pathname2url(resolved_path)


@pytest.mark.parametrize(
Expand Down

0 comments on commit 596be04

Please sign in to comment.