mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
Alerting: Fix notifier tests to close the temp file (#38992)
This commit is contained in:
parent
4c921cf120
commit
6c2884ac37
@ -89,6 +89,9 @@ Labels:
|
||||
func templateForTests(t *testing.T) *template.Template {
|
||||
f, err := ioutil.TempFile("/tmp", "template")
|
||||
require.NoError(t, err)
|
||||
defer func(f *os.File) {
|
||||
_ = f.Close()
|
||||
}(f)
|
||||
|
||||
t.Cleanup(func() {
|
||||
require.NoError(t, os.RemoveAll(f.Name()))
|
||||
|
@ -58,6 +58,9 @@ func TestDefaultTemplateString(t *testing.T) {
|
||||
|
||||
f, err := ioutil.TempFile("/tmp", "template")
|
||||
require.NoError(t, err)
|
||||
defer func(f *os.File) {
|
||||
_ = f.Close()
|
||||
}(f)
|
||||
|
||||
t.Cleanup(func() {
|
||||
require.NoError(t, os.RemoveAll(f.Name()))
|
||||
|
Loading…
Reference in New Issue
Block a user