From 62bacfb34dbea7ca88e22879a8d1699c79d58f97 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 10 Mar 2024 20:15:04 -0400 Subject: Tweak tests --- internal/repositories/migration_db_repo_test.go | 1 + internal/storage/db_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/internal/repositories/migration_db_repo_test.go b/internal/repositories/migration_db_repo_test.go index d54fb24..2a316c9 100644 --- a/internal/repositories/migration_db_repo_test.go +++ b/internal/repositories/migration_db_repo_test.go @@ -124,6 +124,7 @@ func TestApply(t *testing.T) { t.Cleanup(func() { bolttest.DropTable(t, testdb, "tmp") }) + bolttest.DropTable(t, testdb, "tmp") migration := models.NewTimestampMigration(time.Now(), "test") err = repo.Apply(`CREATE TABLE tmp(id INT NOT NULL PRIMARY KEY)`, migration) diff --git a/internal/storage/db_test.go b/internal/storage/db_test.go index 949ab52..4b7dc93 100644 --- a/internal/storage/db_test.go +++ b/internal/storage/db_test.go @@ -114,6 +114,7 @@ func TestTx_Commit(t *testing.T) { bolttest.DropTable(t, db, "tmp") assert.Nil(t, db.Close()) }) + bolttest.DropTable(t, db, "tmp") err = db.Tx(func(db storage.DB) error { _, err = db.Exec(`CREATE TABLE tmp(id int primary key);`) @@ -135,6 +136,7 @@ func TestTx_Rollback(t *testing.T) { bolttest.DropTable(t, db, "tmp") assert.Nil(t, db.Close()) }) + bolttest.DropTable(t, db, "tmp") _, err = db.Exec(`CREATE TABLE tmp(id INT PRIMARY KEY);`) assert.Nil(t, err) expectedErr := errors.New("error!") -- cgit v1.2.3