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 {
|
if setupAllSuite, ok := suite.(SetupAllSuite); ok {
|
||||||
setupAllSuite.SetupSuite()
|
setupAllSuite.SetupSuite()
|
||||||
}
|
}
|
||||||
|
defer func() {
|
||||||
|
if tearDownAllSuite, ok := suite.(TearDownAllSuite); ok {
|
||||||
|
tearDownAllSuite.TearDownSuite()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
methodFinder := reflect.TypeOf(suite)
|
methodFinder := reflect.TypeOf(suite)
|
||||||
tests := []testing.InternalTest{}
|
tests := []testing.InternalTest{}
|
||||||
|
@ -75,10 +80,6 @@ func Run(t *testing.T, suite TestingSuite) {
|
||||||
tests) {
|
tests) {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
if tearDownAllSuite, ok := suite.(TearDownAllSuite); ok {
|
|
||||||
tearDownAllSuite.TearDownSuite()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filtering method according to set regular expression
|
// Filtering method according to set regular expression
|
||||||
|
|
Loading…
Reference in New Issue