mirror of
https://github.com/restic/restic.git
synced 2025-12-03 23:21:47 +00:00
test: Use testing.T.Cleanup to remove tempdirs
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func newTestSuite(t testing.TB) *test.Suite {
|
||||
dir, cleanup := rtest.TempDir(t)
|
||||
dir := rtest.TempDir(t)
|
||||
|
||||
return &test.Suite{
|
||||
// NewConfig returns a config for a new temporary backend that will be used in tests.
|
||||
@@ -43,13 +43,6 @@ func newTestSuite(t testing.TB) *test.Suite {
|
||||
cfg := config.(rclone.Config)
|
||||
return rclone.Open(cfg, nil)
|
||||
},
|
||||
|
||||
// CleanupFn removes data created during the tests.
|
||||
Cleanup: func(config interface{}) error {
|
||||
t.Logf("cleanup dir %v", dir)
|
||||
cleanup()
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user