diff options
author | Walter Dörwald <walter@livinglogic.de> | 2003-08-05 15:34:34 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2003-08-05 15:34:34 (GMT) |
commit | b27cca66342c5e67dde5be3b1451c157025bf3e7 (patch) | |
tree | ad32bcd92545da82c59660b45746c909406019e8 /Lib/test/test_complex.py | |
parent | beb35f4da3439bfa16148ee4ef2a68ccd30ff7ed (diff) | |
download | cpython-b27cca66342c5e67dde5be3b1451c157025bf3e7.zip cpython-b27cca66342c5e67dde5be3b1451c157025bf3e7.tar.gz cpython-b27cca66342c5e67dde5be3b1451c157025bf3e7.tar.bz2 |
Check both __div__ and __truediv__ in division tests.
(From SF patch #543867)
Diffstat (limited to 'Lib/test/test_complex.py')
-rw-r--r-- | Lib/test/test_complex.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py index 0e844d8..592b07a 100644 --- a/Lib/test/test_complex.py +++ b/Lib/test/test_complex.py @@ -1,4 +1,4 @@ -import unittest, os +import unittest, os, math from test import test_support import warnings @@ -55,9 +55,17 @@ class ComplexTest(unittest.TestCase): if x != 0: q = z / x self.assertClose(q, y) + q = z.__div__(x) + self.assertClose(q, y) + q = z.__truediv__(x) + self.assertClose(q, y) if y != 0: q = z / y self.assertClose(q, x) + q = z.__div__(y) + self.assertClose(q, x) + q = z.__truediv__(y) + self.assertClose(q, x) def test_div(self): simple_real = [float(i) for i in xrange(-5, 6)] |