diff --git a/conn_test.go b/conn_test.go index 4161102b..55da3712 100644 --- a/conn_test.go +++ b/conn_test.go @@ -189,8 +189,8 @@ func TestConnectWithConnectionRefused(t *testing.T) { bad.Port = 1 _, err := pgx.Connect(bad) - if !strings.Contains(err.Error(), "connection refused") { - t.Fatal("Unable to establish connection: " + err.Error()) + if err == nil { + t.Fatal("Expected error establishing connection to bad port") } }