testing: Error on teardown failures

This commit is contained in:
Aaron Lindsay 2017-10-11 05:48:31 -04:00
parent 14b0839b41
commit 3c5e726f93
1 changed files with 6 additions and 1 deletions

View File

@ -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)
}