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

Function TestSQLOpenFromPool

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

Source from the content-addressed store, hash-verified

169}
170
171func TestSQLOpenFromPool(t *testing.T) {
172 pool, err := pgxpool.New(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
173 require.NoError(t, err)
174 t.Cleanup(pool.Close)
175
176 db := stdlib.OpenDBFromPool(pool)
177 ensureDBValid(t, db)
178
179 db.Close()
180}
181
182func TestNormalLifeCycle(t *testing.T) {
183 db := openDB(t)

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
OpenDBFromPoolFunction · 0.92
ensureDBValidFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected