From 95423212626f490b8c6434b420a4cd567110f41a Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 11 Mar 2024 20:42:20 -0400 Subject: Tweak table cleanup logic for tests --- internal/repositories/migration_db_repo_test.go | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'internal/repositories') diff --git a/internal/repositories/migration_db_repo_test.go b/internal/repositories/migration_db_repo_test.go index 9c5d824..37efe37 100644 --- a/internal/repositories/migration_db_repo_test.go +++ b/internal/repositories/migration_db_repo_test.go @@ -121,10 +121,6 @@ func TestApply(t *testing.T) { testdb := bolttest.NewTestDB(t) repo, err := repositories.NewMigrationDBRepo(testdb) assert.Nil(t, err) - 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) @@ -166,9 +162,6 @@ func TestApplyWithTx_SuccessfullyApplied(t *testing.T) { testdb := bolttest.NewTestDB(t) repo, err := repositories.NewMigrationDBRepo(testdb) assert.Nil(t, err) - t.Cleanup(func() { - bolttest.DropTable(t, testdb, "tmp") - }) migration := models.NewTimestampMigration(time.Now(), "test") err = repo.ApplyWithTx(`CREATE TABLE tmp(id INT NOT NULL PRIMARY KEY)`, migration) @@ -187,9 +180,6 @@ func TestRevert(t *testing.T) { testdb := bolttest.NewTestDB(t) repo, err := repositories.NewMigrationDBRepo(testdb) assert.Nil(t, err) - t.Cleanup(func() { - bolttest.DropTable(t, testdb, "tmp") - }) _, err = testdb.Exec(`CREATE TABLE tmp(id INT NOT NULL PRIMARY KEY)`) assert.Nil(t, err) @@ -242,10 +232,6 @@ func TestRevertWithTx_SuccessfullyReverted(t *testing.T) { testdb := bolttest.NewTestDB(t) repo, err := repositories.NewMigrationDBRepo(testdb) assert.Nil(t, err) - t.Cleanup(func() { - bolttest.DropTable(t, testdb, "tmp") - }) - bolttest.DropTable(t, testdb, "tmp") _, err = testdb.Exec(`CREATE TABLE tmp(id INT NOT NULL PRIMARY KEY)`) assert.Nil(t, err) -- cgit v1.2.3