mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
division is no longer a future thing for test_binop
This commit is contained in:
parent
f04779b59a
commit
42806bad9b
1 changed files with 7 additions and 12 deletions
|
@ -301,20 +301,15 @@ class RatTestCase(unittest.TestCase):
|
||||||
self.assertEqual(Rat(10), 10.0)
|
self.assertEqual(Rat(10), 10.0)
|
||||||
self.assertEqual(10.0, Rat(10))
|
self.assertEqual(10.0, Rat(10))
|
||||||
|
|
||||||
def test_future_div(self):
|
def test_true_div(self):
|
||||||
exec(future_test)
|
|
||||||
|
|
||||||
# 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) / Rat(5, 7), Rat(14, 3))
|
||||||
self.assertEqual(Rat(10, 3) / 3, Rat(10, 9))
|
self.assertEqual(Rat(10, 3) / 3, Rat(10, 9))
|
||||||
self.assertEqual(2 / Rat(5), Rat(2, 5))
|
self.assertEqual(2 / Rat(5), Rat(2, 5))
|
||||||
self.assertEqual(3.0 * Rat(1, 2), 1.5)
|
self.assertEqual(3.0 * Rat(1, 2), 1.5)
|
||||||
self.assertEqual(Rat(1, 2) * 3.0, 1.5)
|
self.assertEqual(Rat(1, 2) * 3.0, 1.5)
|
||||||
self.assertEqual(eval('1/2'), 0.5)
|
self.assertEqual(eval('1/2'), 0.5)
|
||||||
"""
|
|
||||||
|
# XXX Ran out of steam; TO DO: divmod, div, future division
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
support.run_unittest(RatTestCase)
|
support.run_unittest(RatTestCase)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue