chore: simplify testing panics

This commit is contained in:
Manuel de la Peña
2024-12-12 06:28:19 +01:00
parent 8ee81305a1
commit bff5333d67
2 changed files with 14 additions and 20 deletions

View File

@@ -236,14 +236,11 @@ func Test_Postgres_Non_UTF8(t *testing.T) {
}
func Test_SslRequiredMode(t *testing.T) {
defer func() {
if recover() == nil {
require.Equalf(t, true, nil, "Connection was established with a `require`")
}
}()
_ = New(Config{
Reset: true,
})
require.Panics(t, func() {
_ = New(Config{
Reset: true,
})
}, "Expected panic when connecting to Postgres with SSL mode set to require")
}
func Test_Postgres_Conn(t *testing.T) {