Another str -> repr change affecting a float.

This commit is contained in:
Sei Lisa 2015-12-09 03:43:59 +01:00
parent 025f0f8440
commit 055663b79d

View file

@ -49,7 +49,7 @@ def reallyequal(actual, expected, tol):
# Deal with floats (edge cases, tolerance)
if isinstance(actual, float):
if actual == 0.0:
return str(actual) == str(expected)
return repr(actual) == repr(expected)
elif math.isnan(actual):
return math.isnan(expected)
return abs(actual - expected) <= tol