Skip to content

Commit

Permalink
Some more changes to make pytest-randomly happy (networkx#5719)
Browse files Browse the repository at this point in the history
* Compare edges without worrying about order to work with pytest-randomly

* add another revert to make pytest randomly pass
  • Loading branch information
MridulS authored and cvanelteren committed Apr 22, 2024
1 parent 4439545 commit 8391650
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion networkx/classes/tests/test_subgraphviews.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest

import networkx as nx
from networkx.utils import edges_equal


class TestSubGraphView:
Expand Down Expand Up @@ -292,7 +293,9 @@ def test_correct_nodes(self):

def test_correct_edges(self):
"""Tests that the subgraph has the correct edges."""
assert [(0, 1, "edge01"), (3, 4, "edge34")] == sorted(self.H.edges.data("name"))
assert edges_equal(
[(0, 1, "edge01"), (3, 4, "edge34")], self.H.edges.data("name")
)

def test_add_node(self):
"""Tests that adding a node to the original graph does not
Expand All @@ -310,6 +313,7 @@ def test_remove_node(self):
"""
self.G.remove_node(0)
assert [1, 3, 4] == sorted(self.H.nodes)
self.G.add_node(0, name="node0")
self.G.add_edge(0, 1, name="edge01")

def test_node_attr_dict(self):
Expand Down

0 comments on commit 8391650

Please sign in to comment.