From 3936c56393aa1decf4abb943058294064387d90f Mon Sep 17 00:00:00 2001 From: Alimi Qudirah Date: Mon, 24 Oct 2022 21:23:45 +0100 Subject: Improve test coverage for graph class (#6105) * fixes #6036 * test load centrality * test dispersion * test dispersion * dispersion test * test dispersion * bug-fixes-for-issue-6088 * deleted * bug-fix-for-issue-6092 * bugfix-for-issue-6088 * bugfix-for-issue-6088 * bugfix-for-issue-6088 * bugfix-for-issue-6102 * bugfix-for-issue-6102 * bugfix-for-issue-6102 --- networkx/classes/tests/test_graph.py | 5 +++++ 1 file changed, 5 insertions(+) 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() -- cgit v1.2.1