[issue30190] unittest's assertAlmostEqual should show the difference

Giampaolo Rodola' report at bugs.python.org
Thu Apr 27 16:12:42 EDT 2017


New submission from Giampaolo Rodola':

When comparing 2 numbers as "self.assertAlmostEqual(a, b, delta=1000)" the error message looks like this:

    AssertionError: 27332885 != 27391120 within 1000 delta

Especially when a and b are big numbers or differ a lot, it would be useful to see the absolute difference between the 2 numbers as in:

    AssertionError: 27332885 != 27391120 within 1000 delta (58235 difference)

----------
messages: 292477
nosy: giampaolo.rodola
priority: normal
severity: normal
stage: needs patch
status: open
title: unittest's assertAlmostEqual should show the difference
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30190>
_______________________________________


More information about the Python-bugs-list mailing list