'Searches for the branch in which the node is and returns the
corresponding test node (see function above). However if the node is in
the test node itself and not in the suite return None.'

def get_corresponding_test_node(self, node):

    start_pos = node.start_pos
    for check_node in reversed(list(self.get_test_nodes())):
        if (check_node.start_pos < start_pos):
            if (start_pos < check_node.end_pos):
                return None
            else:
                return check_node
