MCPcopy Create free account
hub / github.com/datacamp/pythonwhat / __init__

Method __init__

pythonwhat/probe.py:46–57  ·  view source on GitHub ↗

Represent a tree of nodes, by holding the currently active node. This class is necessary to put sub-tests onto a graph, because they may exist inside of function calls. By getting the currently active node from the tree, Probe instances may add subtests as children

(self)

Source from the content-addressed store, hash-verified

44
45class Tree(object):
46 def __init__(self):
47 """
48 Represent a tree of nodes, by holding the currently active node.
49
50 This class is necessary to put sub-tests onto a graph, because they may
51 exist inside of function calls. By getting the currently active node
52 from the tree, Probe instances may add subtests as children on that node,
53 and update it when recursing over sub-tests.
54
55 """
56 self.root = Node(name="root")
57 self.crnt_node = self.root
58
59 @classmethod
60 def str_branch(cls, node, str_func=lambda s: str(s)):

Callers

nothing calls this directly

Calls 1

NodeClass · 0.85

Tested by

no test coverage detected