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
class AutoTestDictTransform(ScopeTrackingTransform):
# Handles autotestdict directive
blacklist = ['__cinit__', '__dealloc__']
def visit_ModuleNode(self, node):
self.scope_type = 'module'
self.scope_node = node
......@@ -62,6 +64,8 @@ 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:
return node
mod = ModuleRefNode(pos)
if self.scope_type == 'pyclass':
clsname = self.scope_node.name
......
......@@ -61,7 +61,7 @@ class MyClass:
>>> True
True
"""
def method(self):
""">>> add_log("class method")"""
......@@ -75,3 +75,21 @@ cdef class MyCdefClass:
def method(self):
""">>> 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