(t *testing.T)
| 50 | } |
| 51 | |
| 52 | func TestDB(t *testing.T) *pgxpool.Pool { |
| 53 | t.Helper() |
| 54 | |
| 55 | ctx := context.Background() |
| 56 | pool, err := OpenPreparedTestDB(ctx, TestDBURL()) |
| 57 | if err != nil { |
| 58 | t.Skipf("test database not available: %v", err) |
| 59 | } |
| 60 | |
| 61 | t.Cleanup(func() { |
| 62 | TruncateAll(t, pool) |
| 63 | pool.Close() |
| 64 | }) |
| 65 | |
| 66 | return pool |
| 67 | } |
| 68 | |
| 69 | func TruncateAll(t *testing.T, pool *pgxpool.Pool) { |
| 70 | t.Helper() |
no test coverage detected