you could use nose's `with_setup`: https://nose.readthedocs.org/en/latest/testing_tools.html#nose.tools.with_setup