[Python-checkins] python/dist/src/Lib/test test_capi.py,1.8,1.9

loewis at users.sourceforge.net loewis at users.sourceforge.net
Thu Mar 3 10:24:45 CET 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15710/Lib/test

Modified Files:
	test_capi.py 
Log Message:
Clear internal call error in 'L' format. Fixes #723201.
Backported to 2.4.


Index: test_capi.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_capi.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- test_capi.py	26 Aug 2004 05:23:19 -0000	1.8
+++ test_capi.py	3 Mar 2005 09:24:38 -0000	1.9
@@ -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
+import sys, unittest
 from test import test_support
 import _testcapi
 
@@ -35,6 +35,12 @@
         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
@@ -46,3 +52,9 @@
     import threading
     t=threading.Thread(target=TestThreadState)
     t.start()
+
+def test_main():
+    test_support.run_unittest(OtherTests)
+
+if __name__=='__main__':
+    test_main()



More information about the Python-checkins mailing list