def assertEqualWithComparator(comparator):
def decoratedComparator(self, result, check, errMsg=None, **kwargs):<EOL><INDENT>errMsg = errMsg or '<STR_LIT>'<EOL>equal = comparator(self, result, check, **kwargs)<EOL>failureMessage = ('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>if not equal:<EOL><INDENT>self.fail(failureMessage % (errMsg, result, check))<EOL><DEDENT><DEDENT>return decoratedComparator<EOL>
Fail a little less cryptically that unittest.assertTrue when comparing a
result against a target value. Shows the result and the target in the
failure message.