def assertValuesAlmostEqual(self, expected, actual, tolerance=0.05):
    delta = tolerance * expected
    if actual > expected + delta or actual < expected - delta:
      self.fail('%s is not equal to expected %s +/- %s%%' % (
              actual, expected, 100 * tolerance))
Like the following with nicer default message:
dataset/ETHPy150Open chromium/web-page-replay/trafficshaper_test.py/TimedTestCase.assertValuesAlmostEqual