summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2005-03-03 12:26:20 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2005-03-03 12:26:20 (GMT)
commit77c8402c97092b5520ac13ad4ffa4417a08a8db9 (patch)
tree488524c4d07c4ac0b4b1c1db7e17984504502d6c /Lib
parent86509d1ba61ae0d3739abef79ba97eeeeab8fd1b (diff)
downloadcpython-77c8402c97092b5520ac13ad4ffa4417a08a8db9.zip
cpython-77c8402c97092b5520ac13ad4ffa4417a08a8db9.tar.gz
cpython-77c8402c97092b5520ac13ad4ffa4417a08a8db9.tar.bz2
Revert previous checkin on getargs 'L' code. Try to convert all
numbers in PyLong_AsLongLong, and update test suite accordingly.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_capi.py14
-rw-r--r--Lib/test/test_getargs2.py14
2 files changed, 5 insertions, 23 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index 7196b7b..1dd2461 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -1,7 +1,7 @@
# Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
-import sys, unittest
+import sys
from test import test_support
import _testcapi
@@ -35,12 +35,6 @@ def TestThreadState():
raise test_support.TestFailed, \
"Couldn't find main thread correctly in the list"
-# Tests which use _testcapi helpers
-class OtherTests(unittest.TestCase):
- def test_exc_L(self):
- # This used to raise a SystemError(bad internal call)
- self.assertRaises(TypeError, _testcapi.getargs_L, "String")
-
try:
_testcapi._test_thread_state
have_thread_state = True
@@ -52,9 +46,3 @@ if have_thread_state:
import threading
t=threading.Thread(target=TestThreadState)
t.start()
-
-def test_main():
- test_support.run_unittest(OtherTests)
-
-if __name__=='__main__':
- test_main()
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))