mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Make test_math error messages more meaningful for small discrepancies in results
This commit is contained in:
parent
df7f38face
commit
ec2ce9bbae
1 changed files with 5 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue