Author: Ronan Lamy <[email protected]>
Branch: py3.5
Changeset: r91483:4048a8bdc257
Date: 2017-06-01 16:45 +0100
http://bitbucket.org/pypy/pypy/changeset/4048a8bdc257/
Log: Fix test: Python3 rounds to even
diff --git a/pypy/module/__builtin__/test/test_builtin.py
b/pypy/module/__builtin__/test/test_builtin.py
--- a/pypy/module/__builtin__/test/test_builtin.py
+++ b/pypy/module/__builtin__/test/test_builtin.py
@@ -642,7 +642,7 @@
assert round(-(5e15-1)) == -(5e15-1)
assert round(-5e15) == -5e15
assert round(5e15/2) == 5e15/2
- assert round((5e15+1)/2) == 5e15/2+1
+ assert round((5e15+1)/2) == 5e15/2
assert round((5e15-1)/2) == 5e15/2
#
inf = 1e200 * 1e200
@@ -656,7 +656,7 @@
assert round(56294995342131.5, 3) == 56294995342131.5
#
for i in range(-10, 10):
- expected = i if i < 0 else i + 1
+ expected = i + (i % 2)
assert round(i + 0.5) == round(i + 0.5, 0) == expected
x = i * 10 + 5
assert round(x, -1) == round(float(x), -1) == expected * 10
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit