Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

internal/database: defer resetTestDB #338

Merged
merged 1 commit into from
May 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions internal/database/authorized_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func TestGetAuthorizedApp(t *testing.T) {
t.Fatal(err)
}
defer conn.Release()
defer resetTestDB(t)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate from this, I'm curious your thoughts on defer vs t.Cleanup()


// Insert the data
if _, err := conn.Exec(ctx, c.sql, c.args...); err != nil {
Expand All @@ -183,8 +184,6 @@ func TestGetAuthorizedApp(t *testing.T) {
if diff := cmp.Diff(config, c.exp, opts); diff != "" {
t.Errorf("mismatch (-want, +got):\n%s", diff)
}

resetTestDB(t)
})
}
}