MCPcopy Index your code
hub / github.com/networkx/networkx / test_selfloops

Function test_selfloops

networkx/classes/tests/test_function.py:930–936  ·  view source on GitHub ↗
(graph_type)

Source from the content-addressed store, hash-verified

928 "graph_type", [nx.Graph, nx.DiGraph, nx.MultiGraph, nx.MultiDiGraph]
929)
930def test_selfloops(graph_type):
931 G = nx.complete_graph(3, create_using=graph_type)
932 G.add_edge(0, 0)
933 assert nodes_equal(nx.nodes_with_selfloops(G), [0])
934 assert edges_equal(nx.selfloop_edges(G), [(0, 0)])
935 assert edges_equal(nx.selfloop_edges(G, data=True), [(0, 0, {})])
936 assert nx.number_of_selfloops(G) == 1
937
938
939@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

nodes_equalFunction · 0.90
edges_equalFunction · 0.90
add_edgeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…