mirror of
https://github.com/jackc/pgx.git
synced 2025-07-14 16:20:15 +00:00
Use tx instead of underlying conn in test
Improves clarity
This commit is contained in:
parent
608f39f426
commit
d9560c78b8
@ -375,11 +375,11 @@ func TestConnCopyFromEnum(t *testing.T) {
|
||||
{nil, nil, nil, nil, nil, nil},
|
||||
}
|
||||
|
||||
copyCount, err := conn.CopyFrom(ctx, pgx.Identifier{"foo"}, []string{"a", "b", "c", "d", "e", "f"}, pgx.CopyFromRows(inputRows))
|
||||
copyCount, err := tx.CopyFrom(ctx, pgx.Identifier{"foo"}, []string{"a", "b", "c", "d", "e", "f"}, pgx.CopyFromRows(inputRows))
|
||||
require.NoError(t, err)
|
||||
require.EqualValues(t, len(inputRows), copyCount)
|
||||
|
||||
rows, err := conn.Query(ctx, "select * from foo")
|
||||
rows, err := tx.Query(ctx, "select * from foo")
|
||||
require.NoError(t, err)
|
||||
|
||||
var outputRows [][]any
|
||||
@ -395,6 +395,9 @@ func TestConnCopyFromEnum(t *testing.T) {
|
||||
t.Errorf("Input rows and output rows do not equal: %v -> %v", inputRows, outputRows)
|
||||
}
|
||||
|
||||
err = tx.Rollback(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
ensureConnValid(t, conn)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user