You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Methods of existing BeforeTest and AfterTest interfaces are called after SetupTest and before TearDownTest ones. I need ones which are called before and after them, i.e. "wrap" whole test with its Setup and TestDown parts. Please add new interfaces BeforeSetupTest and AfterTearDownTest for this.
Use case
I have custom Suite type which wraps suite.Suite. I want to do extra things before and after each test, like printing custom start/end messages and checking for goroutine leaks. For subtests I was able to provide my own Run method which internally calls one from suite.Suite. For tests there is no easy way to do this.
The text was updated successfully, but these errors were encountered:
SetupSuite and TearDownSuite are called before 1st test and after last one, respectively. They are useful to perform some costly global initialization and cleanup for whole test suite, e.g. setup test DB before all tests and shut it down after all tests are completed. So no, they do not satisfy my needs.
I was thinking of just adding your operations that you want to be before SetupTest just on the start of the SetupTest itself, so no need to add another wrapper for this since both SetupTest and your suggested feature is executed in order on each tests.
does that make sense to you?
Description
Methods of existing
BeforeTest
andAfterTest
interfaces are called afterSetupTest
and beforeTearDownTest
ones. I need ones which are called before and after them, i.e. "wrap" whole test with its Setup and TestDown parts. Please add new interfacesBeforeSetupTest
andAfterTearDownTest
for this.Use case
I have custom Suite type which wraps
suite.Suite
. I want to do extra things before and after each test, like printing custom start/end messages and checking for goroutine leaks. For subtests I was able to provide my ownRun
method which internally calls one fromsuite.Suite
. For tests there is no easy way to do this.The text was updated successfully, but these errors were encountered: