Skip to content

Commit 075a3dd

Browse files
authored
Merge pull request #12774 from uranusjr/disable-313-uri-test
Mark failing tests on Windows + Py3.13 as xfail
2 parents 205af8e + 87f874f commit 075a3dd

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

tests/unit/test_collector.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ def test_clean_url_path_with_local_path(path: str, expected: str) -> None:
383383
pytest.param(
384384
"file:///T:/path/with spaces/",
385385
"file:///T:/path/with%20spaces",
386-
marks=pytest.mark.skipif("sys.platform != 'win32'"),
386+
marks=pytest.mark.skipif(
387+
"sys.platform != 'win32' or "
388+
"sys.version_info == (3, 13, 0, 'beta', 2)"
389+
),
387390
),
388391
# URL with Windows drive letter, running on non-windows
389392
# platform. The `:` after the drive should be quoted.
@@ -396,7 +399,10 @@ def test_clean_url_path_with_local_path(path: str, expected: str) -> None:
396399
pytest.param(
397400
"git+file:///T:/with space/[email protected]#egg=my-package-1.0",
398401
"git+file:///T:/with%20space/[email protected]#egg=my-package-1.0",
399-
marks=pytest.mark.skipif("sys.platform != 'win32'"),
402+
marks=pytest.mark.skipif(
403+
"sys.platform != 'win32' or "
404+
"sys.version_info == (3, 13, 0, 'beta', 2)"
405+
),
400406
),
401407
# Test a VCS URL with a Windows drive letter and revision,
402408
# running on non-windows platform.

tests/unit/test_urls.py

+24-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,30 @@ def test_path_to_url_unix() -> None:
1515

1616

1717
@pytest.mark.skipif("sys.platform != 'win32'")
18-
def test_path_to_url_win() -> None:
19-
assert path_to_url("c:/tmp/file") == "file:///C:/tmp/file"
20-
assert path_to_url("c:\\tmp\\file") == "file:///C:/tmp/file"
21-
assert path_to_url(r"\\unc\as\path") == "file://unc/as/path"
22-
path = os.path.join(os.getcwd(), "file")
23-
assert path_to_url("file") == "file:" + urllib.request.pathname2url(path)
18+
@pytest.mark.parametrize(
19+
"path, url",
20+
[
21+
pytest.param("c:/tmp/file", "file:///C:/tmp/file", id="posix-path"),
22+
pytest.param("c:\\tmp\\file", "file:///C:/tmp/file", id="nt-path"),
23+
pytest.param(
24+
r"\\unc\as\path",
25+
"file://unc/as/path",
26+
marks=pytest.mark.skipif(
27+
"sys.platform != 'win32' or "
28+
"sys.version_info == (3, 13, 0, 'beta', 2)"
29+
),
30+
id="unc-path",
31+
),
32+
],
33+
)
34+
def test_path_to_url_win(path: str, url: str) -> None:
35+
assert path_to_url(path) == url
36+
37+
38+
@pytest.mark.skipif("sys.platform != 'win32'")
39+
def test_relative_path_to_url_win() -> None:
40+
resolved_path = os.path.join(os.getcwd(), "file")
41+
assert path_to_url("file") == "file:" + urllib.request.pathname2url(resolved_path)
2442

2543

2644
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)