summaryrefslogtreecommitdiff
path: root/Lib/test/test_abstract_numbers.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-02-01 08:12:03 +0000
committerChristian Heimes <christian@cheimes.de>2008-02-01 08:12:03 +0000
commit2bd4ec2c17decfd1a10d814b65235c9011fbe348 (patch)
treeb8f5f89f01e82d7497f9fd2c8e85f20361d68124 /Lib/test/test_abstract_numbers.py
parent546cf15faf6fc914e182f020d97493a89545d1a1 (diff)
downloadcpython-2bd4ec2c17decfd1a10d814b65235c9011fbe348.tar.gz
Merged revisions 60475-60479,60481-60488 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r60482 | raymond.hettinger | 2008-01-31 23:07:16 +0100 (Thu, 31 Jan 2008) | 1 line Minor wordsmithing on docstring ........ r60483 | mark.dickinson | 2008-01-31 23:17:37 +0100 (Thu, 31 Jan 2008) | 5 lines Issue #1678380. Fix a bug that identifies 0j and -0j when they appear in the same code unit. The fix is essentially the same as the fix for a previous bug identifying 0. and -0. ........ r60484 | christian.heimes | 2008-02-01 00:08:23 +0100 (Fri, 01 Feb 2008) | 1 line Fixed bug #1983: Return from fork() is pid_t, not int ........ r60486 | jeffrey.yasskin | 2008-02-01 07:22:46 +0100 (Fri, 01 Feb 2008) | 4 lines Move __builtins__.trunc() to math.trunc() per http://mail.python.org/pipermail/python-dev/2008-January/076626.html and issue 1965. ........ r60487 | jeffrey.yasskin | 2008-02-01 08:05:46 +0100 (Fri, 01 Feb 2008) | 3 lines Roll back r60248. It's useful to encourage users not to change Rational instances. ........ r60488 | neal.norwitz | 2008-02-01 08:22:59 +0100 (Fri, 01 Feb 2008) | 1 line Fix refleak ........
Diffstat (limited to 'Lib/test/test_abstract_numbers.py')
-rw-r--r--Lib/test/test_abstract_numbers.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/test/test_abstract_numbers.py b/Lib/test/test_abstract_numbers.py
index aa383da911..317d333d88 100644
--- a/Lib/test/test_abstract_numbers.py
+++ b/Lib/test/test_abstract_numbers.py
@@ -1,11 +1,12 @@
"""Unit tests for numbers.py."""
+import math
+import operator
import unittest
-from test import test_support
-from numbers import Number
-from numbers import Exact, Inexact
from numbers import Complex, Real, Rational, Integral
-import operator
+from numbers import Exact, Inexact
+from numbers import Number
+from test import test_support
class TestNumbers(unittest.TestCase):
def test_int(self):
@@ -37,7 +38,8 @@ class TestNumbers(unittest.TestCase):
self.failUnless(issubclass(complex, Inexact))
c1, c2 = complex(3, 2), complex(4,1)
- self.assertRaises(TypeError, trunc, c1)
+ # XXX: This is not ideal, but see the comment in math_trunc().
+ self.assertRaises(TypeError, math.trunc, c1)
self.assertRaises(TypeError, operator.mod, c1, c2)
self.assertRaises(TypeError, divmod, c1, c2)
self.assertRaises(TypeError, operator.floordiv, c1, c2)