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

Method RunTest

pgxtest/pgxtest.go:67–80  ·  pgxtest/pgxtest.go::ConnTestRunner.RunTest
(ctx context.Context, t testing.TB, f func(ctx context.Context, t testing.TB, conn *pgx.Conn))

Source from the content-addressed store, hash-verified

65}
66
67func (ctr *ConnTestRunner) RunTest(ctx context.Context, t testing.TB, f func(ctx context.Context, t testing.TB, conn *pgx.Conn)) {
68 t.Helper()
69
70 config := ctr.CreateConfig(ctx, t)
71 conn, err := pgx.ConnectConfig(ctx, config)
72 if err != nil {
73 t.Fatalf("ConnectConfig failed: %v", err)
74 }
75 defer ctr.CloseConn(ctx, t, conn)
76
77 ctr.AfterConnect(ctx, t, conn)
78 f(ctx, t, conn)
79 ctr.AfterTest(ctx, t, conn)
80}
81
82// RunWithQueryExecModes runs a f in a new test for each element of modes with a new connection created using connector.
83// If modes is nil all pgx.QueryExecModes are tested.

Calls

no outgoing calls