From 5136d4a68d57a6c023f41098771208ad4cb75e21 Mon Sep 17 00:00:00 2001 From: Myles Scolnick Date: Thu, 16 Jul 2026 15:52:37 -0400 Subject: [PATCH] test: make file URL netloc wheel test drive-independent on Windows --- tests/_cli/test_cli_export.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/_cli/test_cli_export.py b/tests/_cli/test_cli_export.py index 9480f886e55..b664b14ece7 100644 --- a/tests/_cli/test_cli_export.py +++ b/tests/_cli/test_cli_export.py @@ -172,10 +172,11 @@ def test_local_wheel_path_preserves_file_url_netloc(tmp_path: Path) -> None: _local_wheel_path("file://server/share/pkg.whl", notebook) == Path("//server/share/pkg.whl").resolve() ) - assert ( - _local_wheel_path("file://localhost/tmp/pkg.whl", notebook) - == Path("/tmp/pkg.whl").resolve() - ) + # "localhost" denotes the local machine, so it is stripped and treated + # the same as an empty authority. + assert _local_wheel_path( + "file://localhost/tmp/pkg.whl", notebook + ) == _local_wheel_path("file:///tmp/pkg.whl", notebook) def test_ruff_import_graph_ignores_successful_stderr(tmp_path: Path) -> None: