diff options
author | Eli Bendersky <eliben@gmail.com> | 2011-02-25 10:14:17 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2011-02-25 10:14:17 (GMT) |
commit | 67ebabd1527d7b461ed6a4e853e100a19751368b (patch) | |
tree | 6e8f86933518d68ea83dda12caf22857df4b3dc3 /Lib/test/test_builtin.py | |
parent | cbbaa96036b8467c21f2c7127a3711fcb405d00f (diff) | |
download | cpython-67ebabd1527d7b461ed6a4e853e100a19751368b.zip cpython-67ebabd1527d7b461ed6a4e853e100a19751368b.tar.gz cpython-67ebabd1527d7b461ed6a4e853e100a19751368b.tar.bz2 |
Removed fcmp and FUZZ from test.support, following the discussion on python-dev:
http://mail.python.org/pipermail/python-dev/2011-January/107735.html
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r-- | Lib/test/test_builtin.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 1469e36..61d4046 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -10,7 +10,7 @@ import ast import types import builtins import random -from test.support import fcmp, TESTFN, unlink, run_unittest, check_warnings +from test.support import TESTFN, unlink, run_unittest, check_warnings from operator import neg @@ -394,10 +394,13 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(divmod(-sys.maxsize-1, -1), (sys.maxsize+1, 0)) - self.assertTrue(not fcmp(divmod(3.25, 1.0), (3.0, 0.25))) - self.assertTrue(not fcmp(divmod(-3.25, 1.0), (-4.0, 0.75))) - self.assertTrue(not fcmp(divmod(3.25, -1.0), (-4.0, -0.75))) - self.assertTrue(not fcmp(divmod(-3.25, -1.0), (3.0, -0.25))) + for num, denom, exp_result in [ (3.25, 1.0, (3.0, 0.25)), + (-3.25, 1.0, (-4.0, 0.75)), + (3.25, -1.0, (-4.0, -0.75)), + (-3.25, -1.0, (3.0, -0.25))]: + result = divmod(num, denom) + self.assertAlmostEqual(result[0], exp_result[0]) + self.assertAlmostEqual(result[1], exp_result[1]) self.assertRaises(TypeError, divmod) |