2
0

Use envvars for stdlib tests

This commit is contained in:
Jack Christensen
2019-05-20 20:39:45 -05:00
parent 29f02807b0
commit 98f3e64bec
3 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ package stdlib_test
import (
"database/sql"
"os"
"testing"
"github.com/jackc/pgx/v4"
@@ -11,7 +12,7 @@ import (
)
func openDB(t *testing.T) *sql.DB {
config, err := pgx.ParseConfig("postgres://pgx_md5:secret@127.0.0.1:5432/pgx_test")
config, err := pgx.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
if err != nil {
t.Fatalf("pgx.ParseConnectionString failed: %v", err)
}