Commit ec2ce9bb authored by Nick Coghlan's avatar Nick Coghlan

Make test_math error messages more meaningful for small discrepancies in results

parent df7f38fa
......@@ -12,7 +12,11 @@ class MathTests(unittest.TestCase):
def ftest(self, name, value, expected):
if abs(value-expected) > eps:
self.fail('%s returned %f, expected %f'%\
# Use %r instead of %f so the error message
# displays full precision. Otherwise discrepancies
# in the last few bits will lead to very confusing
# error messages
self.fail('%s returned %r, expected %r' %
(name, value, expected))
def testConstants(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment