value = UnicodeNode(pos, value=doctest)
self.tests.append(DictItemNode(pos, key=key, value=value))
+ def visit_ExprNode(self, node):
+ # expressions cannot contain functions and lambda expressions
+ # do not have a docstring
+ return node
+
def visit_FuncDefNode(self, node):
if not node.doc:
return node
>>> items.sort()
>>> for key, value in items:
... print('%s ; %s' % (key, value))
-MyCdefClass.cpdef_method (line 76) ; >>> add_log("cpdef class method")
-MyCdefClass.method (line 73) ; >>> add_log("cdef class method")
-MyClass.method (line 62) ; >>> add_log("class method")
-mycpdeffunc (line 49) ; >>> add_log("cpdef")
+MyCdefClass.cpdef_method (line 77) ; >>> add_log("cpdef class method")
+MyCdefClass.method (line 74) ; >>> add_log("cdef class method")
+MyClass.method (line 63) ; >>> add_log("class method")
+mycpdeffunc (line 50) ; >>> add_log("cpdef")
myfunc (line 40) ; >>> add_log("def")
"""
def myfunc():
""">>> add_log("def")"""
+ x = lambda a:1 # no docstring here ...
def doc_without_test():
"""Some docs"""