MCPcopy
hub / github.com/jackc/pgx / TestSQLOpen

Function TestSQLOpen

stdlib/sql_test.go:154–169  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

152}
153
154func TestSQLOpen(t *testing.T) {
155 tests := []struct {
156 driverName string
157 }{
158 {driverName: "pgx"},
159 {driverName: "pgx/v5"},
160 }
161
162 for _, tt := range tests {
163 t.Run(tt.driverName, func(t *testing.T) {
164 db, err := sql.Open(tt.driverName, os.Getenv("PGX_TEST_DATABASE"))
165 require.NoError(t, err)
166 closeDB(t, db)
167 })
168 }
169}
170
171func TestSQLOpenFromPool(t *testing.T) {
172 pool, err := pgxpool.New(context.Background(), os.Getenv("PGX_TEST_DATABASE"))

Callers

nothing calls this directly

Calls 3

closeDBFunction · 0.85
RunMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected