mirror of https://github.com/stretchr/testify.git
Defer suite teardown to align with test teardown
parent
576f6382c0
commit
81a69ed105
|
@ -39,6 +39,11 @@ func Run(t *testing.T, suite TestingSuite) {
|
|||
if setupAllSuite, ok := suite.(SetupAllSuite); ok {
|
||||
setupAllSuite.SetupSuite()
|
||||
}
|
||||
defer func() {
|
||||
if tearDownAllSuite, ok := suite.(TearDownAllSuite); ok {
|
||||
tearDownAllSuite.TearDownSuite()
|
||||
}
|
||||
}()
|
||||
|
||||
methodFinder := reflect.TypeOf(suite)
|
||||
tests := []testing.InternalTest{}
|
||||
|
@ -75,10 +80,6 @@ func Run(t *testing.T, suite TestingSuite) {
|
|||
tests) {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
if tearDownAllSuite, ok := suite.(TearDownAllSuite); ok {
|
||||
tearDownAllSuite.TearDownSuite()
|
||||
}
|
||||
}
|
||||
|
||||
// Filtering method according to set regular expression
|
||||
|
|
Loading…
Reference in New Issue