[Python-checkins] python/dist/src/Lib/test test_descr.py, 1.202, 1.202.2.1

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Thu Mar 3 17:55:55 CET 2005


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

Modified Files:
      Tag: release24-maint
	test_descr.py 
Log Message:
SF bug #1155938: Missing None check for __init__().



Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.202
retrieving revision 1.202.2.1
diff -u -d -r1.202 -r1.202.2.1
--- test_descr.py	7 Aug 2004 20:30:03 -0000	1.202
+++ test_descr.py	3 Mar 2005 16:55:53 -0000	1.202.2.1
@@ -3965,6 +3965,18 @@
     import gc; gc.collect()
     vereq(hasattr(c, 'attr'), False)
 
+def test_init():
+    # SF 1155938
+    class Foo(object):
+        def __init__(self):
+            return 10
+    try:
+        Foo()
+    except TypeError:
+        pass
+    else:
+        raise TestFailed, "did not test __init__() for None return"
+
 
 def test_main():
     weakref_segfault() # Must be first, somehow
@@ -4058,6 +4070,7 @@
     carloverre()
     filefault()
     vicious_descriptor_nonsense()
+    test_init()
 
     if verbose: print "All OK"
 



More information about the Python-checkins mailing list