Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,13 @@ func TestDetectProxyConfig(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Clear all proxy-related environment variables for test isolation
proxyEnvVars := []string{"HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy", "NO_PROXY", "no_proxy"}
for _, key := range proxyEnvVars {
t.Setenv(key, "")
// Clear every variable the checker reads, so the host environment
// cannot leak into the result. Derived from envVarSpecs so that
// variables added there stay isolated.
for _, spec := range envVarSpecs {
for _, key := range spec.names {
t.Setenv(key, "")
}
}

// Set test environment
Expand Down