Commit 449f34ed authored by Eric Chiang's avatar Eric Chiang

storage/sql: print error before calling t.Fatal

parent 4296604f
...@@ -72,15 +72,20 @@ func TestPostgres(t *testing.T) { ...@@ -72,15 +72,20 @@ func TestPostgres(t *testing.T) {
}, },
ConnectionTimeout: 5, ConnectionTimeout: 5,
} }
conn, err := p.open()
if err != nil { // t.Fatal has a bad habbit of not actually printing the error
t.Fatal(err) fatal := func(i interface{}) {
fmt.Fprintln(os.Stdout, i)
t.Fatal(i)
} }
defer conn.Close()
newStorage := func() storage.Storage { newStorage := func() storage.Storage {
conn, err := p.open()
if err != nil {
fatal(err)
}
if err := cleanDB(conn); err != nil { if err := cleanDB(conn); err != nil {
t.Fatal(err) fatal(err)
} }
return conn return conn
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment