I know that variations of this question have been asked over and over but I can't seem to find a good answer.
I have some integration tests which require a live database that is running to perform the tests.
Since starting up and shutting down the database is costly, I don't want to do this for every single test method. Therefore, I want something that will run before all tests in a test suite, and after all tests in a test suite. It's also important that nested test suites don't run their own before and after methods if the root test suite has already defined these.
So to recap:
- I want to run a method before and after tests in a test suite are executed.
- I want to have nested test suites that can be run on their own, or as a larger set of tests and still have these methods called only once.
Does anyone have some good solution for this problem?