Manager: properly close database at end of test

Instead of closing the sqlite database connection, tell GORM to close the
connection. Only that properly closes the DB, so that testing with a file
on disk doesn't fail when trying to delete that file.

No functional changes to the Manager itself.
This commit is contained in:
Sybren A. Stüvel 2024-05-28 12:54:18 +02:00
parent 98cbe6a67d
commit 88f90ef0a5

@ -60,7 +60,7 @@ func CreateTestDB(t *testing.T) (db *DB, closer func()) {
}
closer = func() {
if err := sqliteConn.Close(); err != nil {
if err := db.Close(); err != nil {
t.Fatalf("closing DB: %v", err)
}
}