From 4695d6a05b66245153c438e2019a25665a166747 Mon Sep 17 00:00:00 2001 From: Ben Beasley Date: Tue, 7 Apr 2026 12:29:19 +0100 Subject: [PATCH] Gate a few new tests on the test-pypi feature (#18897) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Makes it easier to run integration tests in offline environments by gating six new tests on the `test-pypi` feature. All of these tests fail in offline environments when they try to make HTTPS requests to PyPI. ## Test Plan Applied as a patch to Fedora’s [`uv` package](https://src.fedoraproject.org/rpms/uv); built and ran integration tests in an offline environment. --- crates/uv/tests/it/workspace_metadata.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/uv/tests/it/workspace_metadata.rs b/crates/uv/tests/it/workspace_metadata.rs index 0cad21b29..f70af696a 100644 --- a/crates/uv/tests/it/workspace_metadata.rs +++ b/crates/uv/tests/it/workspace_metadata.rs @@ -57,6 +57,7 @@ fn workspace_metadata_simple() { /// Test metadata for a root workspace (workspace with a root package). #[test] +#[cfg(feature = "test-pypi")] fn workspace_metadata_root_workspace() -> Result<()> { let context = uv_test::test_context!("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -219,6 +220,7 @@ fn workspace_metadata_root_workspace() -> Result<()> { /// Test metadata for a virtual workspace (no root package). #[test] +#[cfg(feature = "test-pypi")] fn workspace_metadata_virtual_workspace() -> Result<()> { let context = uv_test::test_context!("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -448,6 +450,7 @@ fn workspace_metadata_virtual_workspace() -> Result<()> { /// Test metadata when run from a workspace member directory. #[test] +#[cfg(feature = "test-pypi")] fn workspace_metadata_from_member() -> Result<()> { let context = uv_test::test_context!("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -756,6 +759,7 @@ fn workspace_metadata_single_project() { /// Test metadata with excluded packages. #[test] +#[cfg(feature = "test-pypi")] fn workspace_metadata_with_excluded() -> Result<()> { let context = uv_test::test_context!("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -846,6 +850,7 @@ fn workspace_metadata_with_excluded() -> Result<()> { /// Test metadata with excluded packages. #[test] +#[cfg(feature = "test-pypi")] fn workspace_metadata_group_only() -> Result<()> { let context = uv_test::test_context!("3.12"); let workspace = context.temp_dir.child("workspace"); @@ -934,6 +939,7 @@ fn workspace_metadata_no_project() { /// Test optional-dependencies, dependency-groups, and build-system #[test] +#[cfg(feature = "test-pypi")] fn workspace_metadata_various_dependency_rainbow() -> Result<()> { let context = uv_test::test_context!("3.12"); let workspace = context.temp_dir.child("workspace");