mirror of
https://github.com/stretchr/testify.git
synced 2025-05-31 11:42:44 +00:00
Defer suite teardown to align with test teardown
This commit is contained in:
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…
x
Reference in New Issue
Block a user