From eca58cbae59ecb8def72fd14748bcc07437ed882 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 12 Jan 2026 14:38:50 -0600 Subject: [PATCH] Fix incorrect test `token_native_auth_realm` (#17424) The state was leaking in from another test case here. Co-authored-by: Claude --- crates/uv/tests/it/auth.rs | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/crates/uv/tests/it/auth.rs b/crates/uv/tests/it/auth.rs index 4ce3efa29..26c8dff4f 100644 --- a/crates/uv/tests/it/auth.rs +++ b/crates/uv/tests/it/auth.rs @@ -407,17 +407,22 @@ fn token_native_auth_realm() -> Result<()> { .arg("public") .env(EnvVars::UV_PREVIEW_FEATURES, "native-auth") .status()?; + context + .auth_logout() + .arg("pypi-proxy.fly.dev") + .env(EnvVars::UV_PREVIEW_FEATURES, "native-auth") + .status()?; // Without persisted credentials uv_snapshot!(context.auth_token() .arg("pypi-proxy.fly.dev") .env(EnvVars::UV_PREVIEW_FEATURES, "native-auth"), @r" - success: true - exit_code: 0 + success: false + exit_code: 2 ----- stdout ----- - heron ----- stderr ----- + error: Failed to fetch credentials for https://pypi-proxy.fly.dev/ "); // Without persisted credentials (with a username in the request) @@ -479,28 +484,28 @@ fn token_native_auth_realm() -> Result<()> { ----- stderr ----- "); - // Without the username + // Without the username (defaults to __token__ which wasn't stored) uv_snapshot!(context.auth_token() .arg("pypi-proxy.fly.dev") .env(EnvVars::UV_PREVIEW_FEATURES, "native-auth"), @r" - success: true - exit_code: 0 + success: false + exit_code: 2 ----- stdout ----- - heron ----- stderr ----- + error: Failed to fetch credentials for https://pypi-proxy.fly.dev/ "); - // Without the username + // Without the username (defaults to __token__ which wasn't stored) uv_snapshot!(context.auth_token() .arg("https://pypi-proxy.fly.dev/basic-auth/simple") .env(EnvVars::UV_PREVIEW_FEATURES, "native-auth"), @r" - success: true - exit_code: 0 + success: false + exit_code: 2 ----- stdout ----- - heron ----- stderr ----- + error: Failed to fetch credentials for https://pypi-proxy.fly.dev/basic-auth/simple "); // With a mismatched username