Test whether ``edges_equal`` properly compares edges with weight data.
(n, gen, weight)
| 317 | @pytest.mark.parametrize("gen", [nx.complete_graph, nx.path_graph, nx.cycle_graph]) |
| 318 | @pytest.mark.parametrize("weight", [1, 2, 3]) |
| 319 | def test_edges_equal_weighted(n, gen, weight): |
| 320 | """Test whether ``edges_equal`` properly compares edges with weight data.""" |
| 321 | G = gen(n) |
| 322 | H = gen(n) |
| 323 | |
| 324 | G_edges = list(G.edges()) |
| 325 | G.add_weighted_edges_from((*e, weight) for e in G_edges) |
| 326 | assert edges_equal(G.edges(), G.edges()) |
| 327 | |
| 328 | H.add_weighted_edges_from((*e, weight + 1) for e in G_edges) |
| 329 | assert edges_equal(H.edges(), H.edges()) |
| 330 | assert not edges_equal(G.edges(data=True), H.edges(data=True)) |
| 331 | |
| 332 | |
| 333 | def test_edges_equal_data(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…