Commit b27cca66 authored by Walter Dörwald's avatar Walter Dörwald

Check both __div__ and __truediv__ in division tests.

(From SF patch #543867)
parent beb35f4d
import unittest, os import unittest, os, math
from test import test_support from test import test_support
import warnings import warnings
...@@ -55,9 +55,17 @@ class ComplexTest(unittest.TestCase): ...@@ -55,9 +55,17 @@ class ComplexTest(unittest.TestCase):
if x != 0: if x != 0:
q = z / x q = z / x
self.assertClose(q, y) self.assertClose(q, y)
q = z.__div__(x)
self.assertClose(q, y)
q = z.__truediv__(x)
self.assertClose(q, y)
if y != 0: if y != 0:
q = z / y q = z / y
self.assertClose(q, x) self.assertClose(q, x)
q = z.__div__(y)
self.assertClose(q, x)
q = z.__truediv__(y)
self.assertClose(q, x)
def test_div(self): def test_div(self):
simple_real = [float(i) for i in xrange(-5, 6)] simple_real = [float(i) for i in xrange(-5, 6)]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment