diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-06-28 23:34:00 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-06-28 23:34:00 (GMT) |
commit | 42806bad9bb1a3f16bd53f90078bf24c648e1431 (patch) | |
tree | 2f3ddc0c04384871eb7e273a5a91c7cdf34c4d38 /Lib/test | |
parent | f04779b59a1eb7044c1bee0c7c288dfcb3ac4542 (diff) | |
download | cpython-42806bad9bb1a3f16bd53f90078bf24c648e1431.zip cpython-42806bad9bb1a3f16bd53f90078bf24c648e1431.tar.gz cpython-42806bad9bb1a3f16bd53f90078bf24c648e1431.tar.bz2 |
division is no longer a future thing for test_binop
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_binop.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/Lib/test/test_binop.py b/Lib/test/test_binop.py index b260b1b..f60fe3f 100644 --- a/Lib/test/test_binop.py +++ b/Lib/test/test_binop.py @@ -301,21 +301,16 @@ class RatTestCase(unittest.TestCase): self.assertEqual(Rat(10), 10.0) self.assertEqual(10.0, Rat(10)) - def test_future_div(self): - exec(future_test) + def test_true_div(self): + self.assertEqual(Rat(10, 3) / Rat(5, 7), Rat(14, 3)) + self.assertEqual(Rat(10, 3) / 3, Rat(10, 9)) + self.assertEqual(2 / Rat(5), Rat(2, 5)) + self.assertEqual(3.0 * Rat(1, 2), 1.5) + self.assertEqual(Rat(1, 2) * 3.0, 1.5) + self.assertEqual(eval('1/2'), 0.5) # XXX Ran out of steam; TO DO: divmod, div, future division -future_test = """ -from __future__ import division -self.assertEqual(Rat(10, 3) / Rat(5, 7), Rat(14, 3)) -self.assertEqual(Rat(10, 3) / 3, Rat(10, 9)) -self.assertEqual(2 / Rat(5), Rat(2, 5)) -self.assertEqual(3.0 * Rat(1, 2), 1.5) -self.assertEqual(Rat(1, 2) * 3.0, 1.5) -self.assertEqual(eval('1/2'), 0.5) -""" - def test_main(): support.run_unittest(RatTestCase) |