diff --git a/interfaces/cython/cantera/test/utilities.py b/interfaces/cython/cantera/test/utilities.py index f507eb298..fa0d391fc 100644 --- a/interfaces/cython/cantera/test/utilities.py +++ b/interfaces/cython/cantera/test/utilities.py @@ -1,9 +1,10 @@ import numpy as np import unittest + class CanteraTest(unittest.TestCase): def assertNear(self, a, b, rtol=1e-8, atol=1e-12, msg=None): - cmp = 2 * abs(a - b)/(abs(a) + abs(b) + atol) + cmp = 2 * abs(a - b)/(abs(a) + abs(b) + 2 * atol / rtol) if cmp > rtol: message = ('AssertNear: %.14g - %.14g = %.14g\n' % (a, b, a-b) + 'Relative error of %10e exceeds rtol = %10e' % (cmp, rtol))