[issue30515] unittest: assertAlmostEqual rounding error

2017-05-30 Thread sam-s
sam-s added the comment: you are right, sorry. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue30515] unittest: assertAlmostEqual rounding error

2017-05-30 Thread Mark Dickinson
Mark Dickinson added the comment: The `assertAlmostEqual` comparison looks at the difference between the two values, and rounds that to 2 decimal places. In this case, the difference is approximately 0.00505, which rounded to 2 decimal places is 0.01. If instead each of the two values were rou

[issue30515] unittest: assertAlmostEqual rounding error

2017-05-30 Thread sam-s
New submission from sam-s: I get this `unittest` failure: ``` Traceback (most recent call last): File "zzz.py", line 348, in test_opposite self.assertAlmostEqual(a, b, places=2) AssertionError: 1.1036640046288428 != 1.0986122886681098 within 2 places ``` This seems incorrect: 1.1036640046