def run(self):
# create a list of document nodes to return
doc_nodes = []
for arg in self.arguments:
# grabbing a list of the code segments that contain the
# title, source, and output of a test segment.
code = get_source_code_of_class_or_method(arg)
# we want the body of test code to be formatted and code highlighted
body = nodes.literal_block(code, code)
body['language'] = 'python'
# put the nodes we've created in the list, and return them
doc_nodes.append(body)
return doc_nodes
评论列表
文章目录