From 3c5e726f93ae0bd008df8ad6d1ba0ddafdd5fb24 Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Wed, 11 Oct 2017 05:48:31 -0400 Subject: [PATCH] testing: Error on teardown failures --- internal/handlers/common_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/handlers/common_test.go b/internal/handlers/common_test.go index e5dc3d2..6856875 100644 --- a/internal/handlers/common_test.go +++ b/internal/handlers/common_test.go @@ -164,7 +164,12 @@ func RunWith(t *testing.T, d *TestData, fn TestDataFunc) { if err != nil { t.Fatal("Failed to initialize test data: %s", err) } - defer testdata.Teardown() + defer func() { + err := testdata.Teardown() + if err != nil { + t.Fatal(err) + } + }() fn(t, testdata) }