nose2 ships with various decorators that assist you to write your tests.
A decorator that sets the setup() method to be executed before the test.
setup()
It currently works only for function test cases.
setup (function) – The method to be executed before the test.
A decorator that sets the teardown() method to be after before the test.
teardown()
teardown (function) – The method to be executed after the test.