

def test_topological_sort4(self):
    G = nx.Graph()
    G.add_edge(1, 2)
    assert_raises(nx.NetworkXError, nx.topological_sort, G)
    assert_raises(nx.NetworkXError, nx.topological_sort_recursive, G)

dataset/ETHPy150Open gkno/gkno_launcher/src/networkx/algorithms/tests/test_dag.py TestDAG.test_topological_sort4/original