summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlimi Qudirah <qudrohbidemi@gmail.com>2022-10-24 21:23:45 +0100
committerJarrod Millman <jarrod.millman@gmail.com>2022-11-01 10:28:10 -0700
commit3936c56393aa1decf4abb943058294064387d90f (patch)
tree535026e492d73e1d4118906d9c6c7515f592f866
parent4d96ab94816b535a6fc5d4bf41ce1424889cbf95 (diff)
downloadnetworkx-3936c56393aa1decf4abb943058294064387d90f.tar.gz
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
-rw-r--r--networkx/classes/tests/test_graph.py5
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()