Fix some bad rows.Err() handlings in tests

pull/1336/head
Baptiste Fontaine 2022-10-14 16:44:43 +00:00 committed by Jack Christensen
parent f2e7c8144d
commit 7a9e70d1e0
3 changed files with 6 additions and 6 deletions

View File

@ -575,7 +575,7 @@ func TestListenNotifyWhileBusyIsSafe(t *testing.T) {
}
if rows.Err() != nil {
t.Errorf("conn.Query failed: %v", err)
t.Errorf("conn.Query failed: %v", rows.Err())
return
}

View File

@ -79,7 +79,7 @@ func ensureConnValid(t testing.TB, conn *pgx.Conn) {
}
if rows.Err() != nil {
t.Fatalf("conn.Query failed: %v", err)
t.Fatalf("conn.Query failed: %v", rows.Err())
}
if rowCount != 10 {

View File

@ -42,7 +42,7 @@ func TestConnQueryScan(t *testing.T) {
}
if rows.Err() != nil {
t.Fatalf("conn.Query failed: %v", err)
t.Fatalf("conn.Query failed: %v", rows.Err())
}
assert.Equal(t, "SELECT 10", rows.CommandTag().String())
@ -126,7 +126,7 @@ func TestConnQueryScanWithManyColumns(t *testing.T) {
}
if rows.Err() != nil {
t.Fatalf("conn.Query failed: %v", err)
t.Fatalf("conn.Query failed: %v", rows.Err())
}
if rowCount != 5 {
@ -162,7 +162,7 @@ func TestConnQueryValues(t *testing.T) {
}
if rows.Err() != nil {
t.Fatalf("conn.Query failed: %v", err)
t.Fatalf("conn.Query failed: %v", rows.Err())
}
if rowCount != 10 {
@ -1988,7 +1988,7 @@ insert into products (name, price) values
// The first error encountered by the original Query call, rows.Next or rows.Scan will be returned here.
if rows.Err() != nil {
fmt.Printf("rows error: %v", err)
fmt.Printf("rows error: %v", rows.Err())
return
}