sqldb: close test db in cleanup
This commit is contained in:
1 file changed
+8
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user