mirror of https://github.com/stretchr/testify.git
Formatting, restore T after test is over just in case
parent
5739ba4d16
commit
72c1136caa
6
doc.go
6
doc.go
|
@ -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"
|
||||
)
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue