diff options
author | Jeffrey Yasskin <jyasskin@gmail.com> | 2008-01-04 08:01:23 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@gmail.com> | 2008-01-04 08:01:23 +0000 |
commit | 737c73f96ff52cda4b433d25f887525442b7b430 (patch) | |
tree | bd81e5e6f6410395f6f2acc3d634c8f2d3be8c39 /Lib/test/test_math.py | |
parent | e0734e7dc0dcccc91ed657191b804b3a846ad3f6 (diff) | |
download | cpython-git-737c73f96ff52cda4b433d25f887525442b7b430.tar.gz |
Make math.{floor,ceil}({int,long}) return float again for backwards
compatibility after r59671 made them return integral types.
Diffstat (limited to 'Lib/test/test_math.py')
-rw-r--r-- | Lib/test/test_math.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py index f5bf1a3f98..5313c3cad0 100644 --- a/Lib/test/test_math.py +++ b/Lib/test/test_math.py @@ -51,6 +51,10 @@ class MathTests(unittest.TestCase): def testCeil(self): self.assertRaises(TypeError, math.ceil) + # These types will be int in py3k. + self.assertEquals(float, type(math.ceil(1))) + self.assertEquals(float, type(math.ceil(1L))) + self.assertEquals(float, type(math.ceil(1.0))) self.ftest('ceil(0.5)', math.ceil(0.5), 1) self.ftest('ceil(1.0)', math.ceil(1.0), 1) self.ftest('ceil(1.5)', math.ceil(1.5), 2) @@ -103,6 +107,10 @@ class MathTests(unittest.TestCase): def testFloor(self): self.assertRaises(TypeError, math.floor) + # These types will be int in py3k. + self.assertEquals(float, type(math.floor(1))) + self.assertEquals(float, type(math.floor(1L))) + self.assertEquals(float, type(math.floor(1.0))) self.ftest('floor(0.5)', math.floor(0.5), 0) self.ftest('floor(1.0)', math.floor(1.0), 1) self.ftest('floor(1.5)', math.floor(1.5), 1) |