diff options
Diffstat (limited to 'internal/db/main_test.go')
-rw-r--r-- | internal/db/main_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/db/main_test.go b/internal/db/main_test.go index 172f00fe..c6cc6f9e 100644 --- a/internal/db/main_test.go +++ b/internal/db/main_test.go @@ -42,7 +42,11 @@ func TestMain(m *testing.M) { } // clearTables removes all rows from given tables. -func clearTables(db *gorm.DB, tables ...interface{}) error { +func clearTables(t *testing.T, db *gorm.DB, tables ...interface{}) error { + if t.Failed() { + return nil + } + for _, t := range tables { err := db.Delete(t).Error if err != nil { |