sqldb: close test db in cleanup

This commit is contained in:
Slyghtning committed 2026-02-02 18:51:39 +01:00
1 parent 20a6b1726f
commit dd29d5690f
1 file changed
+8
+8
View File
@@ -155,6 +155,10 @@ func NewTestPostgresDB(t testing.TB, fixture *TestPgFixture) *PostgresStore {
context.Background(), GetMigrations()),
)
t.Cleanup(func() {
require.NoError(t, store.DB.Close())
})
return store
}
@@ -182,5 +186,9 @@ func NewTestPostgresDBWithVersion(t *testing.T, fixture *TestPgFixture,
err = store.ExecuteMigrations(TargetVersion(version))
require.NoError(t, err)
t.Cleanup(func() {
require.NoError(t, store.DB.Close())
})
return store
}