[Python-checkins] python/dist/src/Lib/test test_capi.py, 1.8.2.1,
1.8.2.2 test_getargs2.py, 1.5, 1.5.12.1
loewis at users.sourceforge.net
loewis at users.sourceforge.net
Thu Mar 3 13:26:38 CET 2005
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26793/Lib/test
Modified Files:
Tag: release24-maint
test_capi.py test_getargs2.py
Log Message:
Revert previous checkin on getargs 'L' code. Try to convert all
numbers in PyLong_AsLongLong, and update test suite accordingly.
Index: test_capi.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_capi.py,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -d -r1.8.2.1 -r1.8.2.2
--- test_capi.py 3 Mar 2005 09:24:03 -0000 1.8.2.1
+++ test_capi.py 3 Mar 2005 12:26:05 -0000 1.8.2.2
@@ -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 @@
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 @@
import threading
t=threading.Thread(target=TestThreadState)
t.start()
-
-def test_main():
- test_support.run_unittest(OtherTests)
-
-if __name__=='__main__':
- test_main()
Index: test_getargs2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_getargs2.py,v
retrieving revision 1.5
retrieving revision 1.5.12.1
diff -u -d -r1.5 -r1.5.12.1
--- test_getargs2.py 1 May 2003 17:45:37 -0000 1.5
+++ test_getargs2.py 3 Mar 2005 12:26:05 -0000 1.5.12.1
@@ -187,16 +187,10 @@
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))
More information about the Python-checkins
mailing list