'Raises right errors if not a tree.'

def test_tree_all_pairs_lowest_common_ancestor8(self):

    G = nx.DiGraph([(1, 2), (2, 1)])
    assert_raises(nx.NetworkXError, list, tree_all_pairs_lca(G))
    G = nx.DiGraph([(0, 2), (1, 2)])
    assert_raises(nx.NetworkXError, list, tree_all_pairs_lca(G))
