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

Function TestTxExec

pgxpool/tx_test.go:13–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestTxExec(t *testing.T) {
14 t.Parallel()
15
16 ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
17 defer cancel()
18
19 pool, err := pgxpool.New(ctx, os.Getenv("PGX_TEST_DATABASE"))
20 require.NoError(t, err)
21 defer pool.Close()
22
23 tx, err := pool.Begin(ctx)
24 require.NoError(t, err)
25 defer tx.Rollback(ctx)
26
27 testExec(t, ctx, tx)
28}
29
30func TestTxQuery(t *testing.T) {
31 t.Parallel()

Callers

nothing calls this directly

Calls 5

NewFunction · 0.92
testExecFunction · 0.85
CloseMethod · 0.65
BeginMethod · 0.65
RollbackMethod · 0.65

Tested by

no test coverage detected