]> granicus.if.org Git - python/commitdiff
division is no longer a future thing for test_binop
authorBenjamin Peterson <benjamin@python.org>
Sat, 28 Jun 2008 23:34:00 +0000 (23:34 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sat, 28 Jun 2008 23:34:00 +0000 (23:34 +0000)
Lib/test/test_binop.py

index b260b1bf61421fc3dff8051f72af11bfa6df3f1a..f60fe3f070905fedb3492020ff91bba8558484b8 100644 (file)
@@ -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)