'Called when self.runtest() raises an exception.'

def repr_failure(self, excinfo):

    if isinstance(excinfo.value, DocoptTestException):
        return '\n'.join(('usecase    execution    failed:', self.doc.rstrip(), ('$    %s    %s' % (self.prog, self.argv)), ('result>    %s' % json.dumps(excinfo.value.args[1])), ('expect>    %s' % json.dumps(self.expect))))
