def add_error_patch(result):
 return make_instancemethod(TextTestResult.addError, result)

def add_error_patch ( result ) : return make_instancemethod ( TextTestResult . addError , result )
create a new adderror method to patch into a result instance that recognizes the errorclasses attribute and deals with errorclasses correctly .