test: Use testing.T.Cleanup to remove tempdirs
This commit is contained in:
parent
eae7366563
commit
f90bf84ba7
31 changed files with 79 additions and 176 deletions
|
@ -13,17 +13,12 @@ import (
|
|||
)
|
||||
|
||||
func prepareTempdirRepoSrc(t testing.TB, src archiver.TestDir) (tempdir string, repo restic.Repository, cleanup func()) {
|
||||
tempdir, removeTempdir := rtest.TempDir(t)
|
||||
tempdir = rtest.TempDir(t)
|
||||
repo, removeRepository := repository.TestRepository(t)
|
||||
|
||||
archiver.TestCreateFiles(t, tempdir, src)
|
||||
|
||||
cleanup = func() {
|
||||
removeRepository()
|
||||
removeTempdir()
|
||||
}
|
||||
|
||||
return tempdir, repo, cleanup
|
||||
return tempdir, repo, removeRepository
|
||||
}
|
||||
|
||||
type CheckDump func(t *testing.T, testDir string, testDump *bytes.Buffer) error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue