(ctx context.Context, t testing.TB, f func(ctx context.Context, t testing.TB, conn *pgx.Conn))
| 65 | } |
| 66 | |
| 67 | func (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. |
no outgoing calls