diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2007-07-27 10:36:30 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2007-07-27 10:36:30 (GMT) |
commit | ec2ce9bbaeb9d21fe0390fea7dca8e04be526a23 (patch) | |
tree | d6ecd363329d80177fee25f4515da4b2791a2b10 /Lib/test/test_math.py | |
parent | df7f38faceaf5832170b430565c5df4021be5308 (diff) | |
download | cpython-ec2ce9bbaeb9d21fe0390fea7dca8e04be526a23.zip cpython-ec2ce9bbaeb9d21fe0390fea7dca8e04be526a23.tar.gz cpython-ec2ce9bbaeb9d21fe0390fea7dca8e04be526a23.tar.bz2 |
Make test_math error messages more meaningful for small discrepancies in results
Diffstat (limited to 'Lib/test/test_math.py')
-rw-r--r-- | Lib/test/test_math.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py index 699c621..d86298d 100644 --- a/Lib/test/test_math.py +++ b/Lib/test/test_math.py @@ -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): |