'Fail if C{first} - C{second} > C{tolerance}
@param msg: if msg is None, then the failure message will be
\'%r ~== %r\' % (first, second)'

def assertApproximates(self, first, second, tolerance, msg=None):

    if (abs((first - second)) > tolerance):
        raise self.failureException((msg or ('%s    ~==    %s' % (first, second))))
    return first
