diff --git a/doc.go b/doc.go index 12f5d38..3bde65c 100644 --- a/doc.go +++ b/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" ) diff --git a/suite/suite.go b/suite/suite.go index 1b210fb..284f924 100644 --- a/suite/suite.go +++ b/suite/suite.go @@ -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() }