diff options
Diffstat (limited to 'watcher')
-rw-r--r-- | watcher/filenotify/poller_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/watcher/filenotify/poller_test.go b/watcher/filenotify/poller_test.go index 336314fff..7416f793a 100644 --- a/watcher/filenotify/poller_test.go +++ b/watcher/filenotify/poller_test.go @@ -34,10 +34,14 @@ func TestPollerAddRemove(t *testing.T) { c.Assert(w.Add("foo"), qt.Not(qt.IsNil)) c.Assert(w.Remove("foo"), qt.Not(qt.IsNil)) - f, err := os.CreateTemp(t.TempDir(), "asdf") + f, err := os.CreateTemp("", "asdf") if err != nil { t.Fatal(err) } + c.Cleanup(func() { + c.Assert(w.Close(), qt.IsNil) + os.Remove(f.Name()) + }) c.Assert(w.Add(f.Name()), qt.IsNil) c.Assert(w.Remove(f.Name()), qt.IsNil) |