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 0080acf318.
pull/2017/head
Jack Christensen 2024-05-17 09:19:36 -05:00
parent 532bf8f583
commit ded01c0cd9
1 changed files with 2 additions and 7 deletions

View File

@ -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("")