python's unittest testrunner looks for setUpModule() defined in a file to perform before running any test specified in the module. is there a way to use a decorator or some other tool inorder to rename the function name?
for example:
@somedecorator
def globalSetUp():...
will enable unittest's loader to recognize this function as the setUpModule function.
i am usint python2.6 with unittest2 package.
thanks.
Derive from
TestCase
, and in your subclass call your own setup function in thesetUp
method. Then create your classes from this new subclass rather thanTestCase
, and you'll have the desired functionality.