Skip to content

Commit 872523d

Browse files
committed
Mark failing tests on Windows + Py3.13 as xfail
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.
1 parent d94806f commit 872523d

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

tests/unit/test_collector.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,14 @@ 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=[
387+
pytest.mark.skipif("sys.platform != 'win32'"),
388+
pytest.mark.xfail(
389+
reason="Failing in Python 3.13.0a1, fixed in python/cpython#113563",
390+
condition="sys.version_info >= (3, 13)",
391+
strict=True,
392+
),
393+
],
387394
),
388395
# URL with Windows drive letter, running on non-windows
389396
# platform. The `:` after the drive should be quoted.

tests/unit/test_urls.py

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,31 @@ 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.xfail(
27+
reason="Failing in Python 3.13.0a1, fixed in python/cpython#113563",
28+
condition="sys.version_info >= (3, 13)",
29+
strict=True,
30+
),
31+
id="unc-path",
32+
),
33+
],
34+
)
35+
def test_path_to_url_win(path: str, url: str) -> None:
36+
assert path_to_url(path) == url
37+
38+
39+
@pytest.mark.skipif("sys.platform != 'win32'")
40+
def test_relative_path_to_url_win() -> None:
41+
resolved_path = os.path.join(os.getcwd(), "file")
42+
assert path_to_url("file") == "file:" + urllib.request.pathname2url(resolved_path)
2443

2544

2645
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)