Commit 221ef93e authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Incomplete hack for autotestdict, see #387

parent 5e933a2f
...@@ -10,6 +10,8 @@ import Naming ...@@ -10,6 +10,8 @@ import Naming
class AutoTestDictTransform(ScopeTrackingTransform): class AutoTestDictTransform(ScopeTrackingTransform):
# Handles autotestdict directive # Handles autotestdict directive
blacklist = ['__cinit__', '__dealloc__']
def visit_ModuleNode(self, node): def visit_ModuleNode(self, node):
self.scope_type = 'module' self.scope_type = 'module'
self.scope_node = node self.scope_node = node
...@@ -62,6 +64,8 @@ class AutoTestDictTransform(ScopeTrackingTransform): ...@@ -62,6 +64,8 @@ class AutoTestDictTransform(ScopeTrackingTransform):
parent = ModuleRefNode(pos) parent = ModuleRefNode(pos)
name = node.entry.name name = node.entry.name
elif self.scope_type in ('pyclass', 'cclass'): elif self.scope_type in ('pyclass', 'cclass'):
if self.scope_type == 'cclass' and node.name in self.blacklist:
return node
mod = ModuleRefNode(pos) mod = ModuleRefNode(pos)
if self.scope_type == 'pyclass': if self.scope_type == 'pyclass':
clsname = self.scope_node.name clsname = self.scope_node.name
......
...@@ -75,3 +75,21 @@ cdef class MyCdefClass: ...@@ -75,3 +75,21 @@ cdef class MyCdefClass:
def method(self): def method(self):
""">>> add_log("cdef class method")""" """>>> add_log("cdef class method")"""
def __cinit__(self):
"""
Should not be included, as it can't be looked up with getattr
>>> True
False
"""
def __dealloc__(self):
"""
Should not be included, as it can't be looked up with getattr
>>> True
False
"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment