Formatting, restore T after test is over just in case

pull/43/head
Sean Talts 2014-03-07 12:54:55 -05:00
parent 5739ba4d16
commit 72c1136caa
2 changed files with 7 additions and 6 deletions

6
doc.go
View File

@ -12,7 +12,7 @@
package testify
import (
_ "github.com/stretchr/testify/assert"
_ "github.com/stretchr/testify/http"
_ "github.com/stretchr/testify/mock"
_ "github.com/stretchr/testify/assert"
_ "github.com/stretchr/testify/http"
_ "github.com/stretchr/testify/mock"
)

View File

@ -39,6 +39,7 @@ func Run(t *testing.T, suite TestingSuite) {
test := testing.InternalTest{
Name: method.Name,
F: func(t *testing.T) {
parentT := suite.T()
suite.SetT(t)
if setupTestSuite, ok := suite.(SetupTestSuite); ok {
setupTestSuite.SetupTest()
@ -47,15 +48,15 @@ func Run(t *testing.T, suite TestingSuite) {
if tearDownTestSuite, ok := suite.(TearDownTestSuite); ok {
tearDownTestSuite.TearDownTest()
}
suite.SetT(parentT)
},
}
tests = append(tests, test)
}
}
if !testing.RunTests(func(pat, str string) (bool, error) {
return true, nil
}, tests) {
if !testing.RunTests(func(_, _ string) (bool, error) {return true, nil},
tests) {
t.Fail()
}