mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Check both __div__ and __truediv__ in division tests.
(From SF patch #543867)
This commit is contained in:
parent
beb35f4da3
commit
b27cca6634
1 changed files with 9 additions and 1 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue