]> granicus.if.org Git - python/commitdiff
Check both __div__ and __truediv__ in division tests.
authorWalter Dörwald <walter@livinglogic.de>
Tue, 5 Aug 2003 15:34:34 +0000 (15:34 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Tue, 5 Aug 2003 15:34:34 +0000 (15:34 +0000)
(From SF patch #543867)

Lib/test/test_complex.py

index 0e844d826a6530752a9d5b33aba6bbab82ff17a4..592b07a5ec90c3e9ecbece4de278173142fde739 100644 (file)
@@ -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)]