diff --git a/internal/git_fetch_test.go b/internal/git_fetch_test.go index cf3015adf..a6496a215 100644 --- a/internal/git_fetch_test.go +++ b/internal/git_fetch_test.go @@ -30,7 +30,9 @@ func TestFetchRepositoryInfoAPI(t *testing.T) { targetPath := acc.RandomName("/Workspace/Users/" + me.UserName + "/testing-clone-bundle-examples-") stdout, stderr := RequireSuccessfulRun(t, "repos", "create", examplesRepoUrl, examplesRepoProvider, "--path", targetPath) - defer RequireSuccessfulRun(t, "repos", "delete", targetPath) + t.Cleanup(func() { + RequireSuccessfulRun(t, "repos", "delete", targetPath) + }) assert.Empty(t, stderr.String()) assert.NotEmpty(t, stdout.String())