diff options
Diffstat (limited to 'networkx/classes/tests/test_graph.py')
-rw-r--r-- | networkx/classes/tests/test_graph.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/networkx/classes/tests/test_graph.py b/networkx/classes/tests/test_graph.py index 2adb159b..46d51736 100644 --- a/networkx/classes/tests/test_graph.py +++ b/networkx/classes/tests/test_graph.py @@ -683,6 +683,9 @@ class TestGraph(BaseAttrGraphTester): G = self.Graph() G.add_edge(*(0, 1)) assert G.adj == {0: {1: {}}, 1: {0: {}}} + G = self.Graph() + with pytest.raises(ValueError): + G.add_edge(None, "anything") def test_add_edges_from(self): G = self.Graph() @@ -706,6 +709,8 @@ class TestGraph(BaseAttrGraphTester): G.add_edges_from([(0, 1, 2, 3)]) # too many in tuple with pytest.raises(TypeError): G.add_edges_from([0]) # not a tuple + with pytest.raises(ValueError): + G.add_edges_from([(None, 3), (3, 2)]) # None cannot be a node def test_remove_edge(self): G = self.K3.copy() |