summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_getargs2.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2005-03-03 12:26:35 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2005-03-03 12:26:35 (GMT)
commit6ce7ed23d0449daa70f396486fae3c1014d93191 (patch)
tree9a77d8ccb6e6025159945a3a45abf401c99034f7 /Lib/test/test_getargs2.py
parent4bf108d74f2e36f16f4c0c00e7791e418e2d47ff (diff)
downloadcpython-6ce7ed23d0449daa70f396486fae3c1014d93191.zip
cpython-6ce7ed23d0449daa70f396486fae3c1014d93191.tar.gz
cpython-6ce7ed23d0449daa70f396486fae3c1014d93191.tar.bz2
Revert previous checkin on getargs 'L' code. Try to convert all
numbers in PyLong_AsLongLong, and update test suite accordingly. Backported to 2.4.
Diffstat (limited to 'Lib/test/test_getargs2.py')
-rw-r--r--Lib/test/test_getargs2.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py
index 587fe1f..47db73f 100644
--- a/Lib/test/test_getargs2.py
+++ b/Lib/test/test_getargs2.py
@@ -187,16 +187,10 @@ class LongLong_TestCase(unittest.TestCase):
def test_L(self):
from _testcapi import getargs_L
# L returns 'long long', and does range checking (LLONG_MIN ... LLONG_MAX)
-
- # XXX There's a bug in getargs.c, format code "L":
- # If you pass something else than a Python long, you
- # get "Bad argument to internal function".
-
- # So these three tests are commented out:
-
-## self.failUnlessEqual(3, getargs_L(3.14))
-## self.failUnlessEqual(99, getargs_L(Long()))
-## self.failUnlessEqual(99, getargs_L(Int()))
+ self.failUnlessRaises(TypeError, getargs_L, "Hello")
+ self.failUnlessEqual(3, getargs_L(3.14))
+ self.failUnlessEqual(99, getargs_L(Long()))
+ self.failUnlessEqual(99, getargs_L(Int()))
self.assertRaises(OverflowError, getargs_L, LLONG_MIN-1)
self.failUnlessEqual(LLONG_MIN, getargs_L(LLONG_MIN))