Yet another bugfix for autotestdict
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Fri, 16 Oct 2009 11:31:53 +0000 (13:31 +0200)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Fri, 16 Oct 2009 11:31:53 +0000 (13:31 +0200)
Cython/Compiler/AnalysedTreeTransforms.py
tests/run/autotestdict.pyx

index 899925008b984b8a381950cb542522b59c0ba482..933250c6699596c64a8918cb330a2d6509510ff1 100644 (file)
@@ -64,7 +64,11 @@ class AutoTestDictTransform(ScopeTrackingTransform):
                 parent = ModuleRefNode(pos)
                 name = node.entry.name
             elif self.scope_type in ('pyclass', 'cclass'):
-                if self.scope_type == 'cclass' and node.name in self.blacklist:
+                if isinstance(node, CFuncDefNode):
+                    name = node.py_func.name
+                else:
+                    name = node.name
+                if self.scope_type == 'cclass' and name in self.blacklist:
                     return node
                 mod = ModuleRefNode(pos)
                 if self.scope_type == 'pyclass':
index 2cd8d17e1f852a3875e4e7987750040267e9d052..bc1f7fc0dd7412b71620eecd3da418483f6fa5e9 100644 (file)
@@ -12,6 +12,7 @@ all_tests_run() is executed which does final validation.
 >>> items.sort()
 >>> for key, value in items:
 ...     print('%s ; %s' % (key, value))
+MyCdefClass.cpdef_method (line 78) ; >>> add_log("cpdef class method")
 MyCdefClass.method (line 75) ; >>> add_log("cdef class method")
 MyClass.method (line 65) ; >>> add_log("class method")
 doc_without_test (line 47) ; Some docs
@@ -22,7 +23,6 @@ myfunc (line 44) ; >>> add_log("def")
 
 log = []
 
-
 cdef cdeffunc():
     """
     Please don't include me!
@@ -75,6 +75,9 @@ cdef class MyCdefClass:
     def method(self):
         """>>> add_log("cdef class method")"""
 
+    cpdef cpdef_method(self):
+        """>>> add_log("cpdef class method")"""
+
     def __cinit__(self):
         """
         Should not be included, as it can't be looked up with getattr