From ded01c0cd92b7bbdb6f794043685cca71f86fd9f Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Fri, 17 May 2024 09:19:36 -0500 Subject: [PATCH] Fix TestParseConfigEnvLibpq unsetting envars This would cause tests to fail if PG* variables were used for the default connection config for other tests. Previously broken by 0080acf318d162a1128928bc32eadf45cef61fd2. --- pgconn/config_test.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pgconn/config_test.go b/pgconn/config_test.go index 2a45bf71..789ff071 100644 --- a/pgconn/config_test.go +++ b/pgconn/config_test.go @@ -1003,13 +1003,8 @@ func TestParseConfigEnvLibpq(t *testing.T) { } for i, tt := range tests { - for _, n := range pgEnvvars { - err := os.Unsetenv(n) - require.NoError(t, err) - } - - for k, v := range tt.envvars { - t.Setenv(k, v) + for _, env := range pgEnvvars { + t.Setenv(env, tt.envvars[env]) } config, err := pgconn.ParseConfig("")