Skip to content

Mark failing tests on Windows + Py3.13 as xfail #12774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/unit/test_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ def test_clean_url_path_with_local_path(path: str, expected: str) -> None:
pytest.param(
"file:///T:/path/with spaces/",
"file:///T:/path/with%20spaces",
marks=pytest.mark.skipif("sys.platform != 'win32'"),
marks=pytest.mark.skipif(
"sys.platform != 'win32' or "
"sys.version_info == (3, 13, 0, 'beta', 2)"
),
),
# URL with Windows drive letter, running on non-windows
# platform. The `:` after the drive should be quoted.
Expand All @@ -396,7 +399,10 @@ def test_clean_url_path_with_local_path(path: str, expected: str) -> None:
pytest.param(
"git+file:///T:/with space/[email protected]#egg=my-package-1.0",
"git+file:///T:/with%20space/[email protected]#egg=my-package-1.0",
marks=pytest.mark.skipif("sys.platform != 'win32'"),
marks=pytest.mark.skipif(
"sys.platform != 'win32' or "
"sys.version_info == (3, 13, 0, 'beta', 2)"
),
),
# Test a VCS URL with a Windows drive letter and revision,
# running on non-windows platform.
Expand Down
30 changes: 24 additions & 6 deletions tests/unit/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,30 @@ 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:///C:/tmp/file"
assert path_to_url("c:\\tmp\\file") == "file:///C:/tmp/file"
assert path_to_url(r"\\unc\as\path") == "file://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:///C:/tmp/file", id="posix-path"),
pytest.param("c:\\tmp\\file", "file:///C:/tmp/file", id="nt-path"),
pytest.param(
r"\\unc\as\path",
"file://unc/as/path",
marks=pytest.mark.skipif(
"sys.platform != 'win32' or "
"sys.version_info == (3, 13, 0, 'beta', 2)"
),
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
Loading