Beispiel #1
0
 def __str__(self):
     result_str = super(AssertRaisesResult,self).__str__()
     func_str_output = "function call: {0}".format(self.func_str)
     if self.trace:
         return '\n'.join([result_str, util.indent(func_str_output), self.trace])
     else:
         return create_result_str(result_str,
                     [func_str_output, "{0} did not occur"],
                     args=(self.expected,))
Beispiel #2
0
 def __init__(self, lineno, call, result, expected, func, args, kwargs):
     super(AssertRaisesResult,self).__init__(lineno,call,result)
     self.expected = expected.__name__
     self.trace = util.indent(result)
     self.func_str = self._create_func_str(func.func_name, args, kwargs)