MCPcopy
hub / github.com/networkx/networkx / test_edges_equal_multiedge

Function test_edges_equal_multiedge

networkx/utils/tests/test_misc.py:301–313  ·  view source on GitHub ↗

Test whether ``edges_equal`` properly compares edges in multigraphs.

(n, gen, create_using)

Source from the content-addressed store, hash-verified

299@pytest.mark.parametrize("gen", [nx.complete_graph, nx.path_graph, nx.cycle_graph])
300@pytest.mark.parametrize("create_using", [nx.MultiGraph, nx.MultiDiGraph])
301def test_edges_equal_multiedge(n, gen, create_using):
302 """Test whether ``edges_equal`` properly compares edges in multigraphs."""
303 G = gen(n, create_using=create_using)
304 H = gen(n, create_using=create_using)
305
306 G_edges = list(G.edges())
307 G.add_edges_from(G_edges)
308 H.add_edges_from(G_edges)
309 assert edges_equal(G.edges(), H.edges(), directed=G.is_directed())
310
311 H.remove_edge(0, 1)
312 assert edges_equal(H.edges(), H.edges(), directed=H.is_directed())
313 assert not edges_equal(G.edges(), H.edges(), directed=G.is_directed())
314
315
316@pytest.mark.parametrize("n", [5, 10, 20])

Callers

nothing calls this directly

Calls 5

edges_equalFunction · 0.90
edgesMethod · 0.45
add_edges_fromMethod · 0.45
is_directedMethod · 0.45
remove_edgeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…