def _generate_test_method(self, method_name, function): """Allow tests to define new test methods in their __init__'s and have appropriate suites applied.""" suite(*getattr(self, '_suites', set()))(function) setattr( self, method_name, # http://stackoverflow.com/q/4364565 function.__get__(self, type(self)), )
def _generate_test_method(self, method_name, function): """Allow tests to define new test methods in their __init__'s and have appropriate suites applied.""" suite(*getattr(self, '_suites', set()))(function) setattr(self, method_name, instancemethod(function, self, self.__class__))