summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networkx/classes/tests/test_digraph.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/networkx/classes/tests/test_digraph.py b/networkx/classes/tests/test_digraph.py
index c8e86557..b9972f9a 100644
--- a/networkx/classes/tests/test_digraph.py
+++ b/networkx/classes/tests/test_digraph.py
@@ -244,6 +244,8 @@ class TestDiGraph(BaseAttrDiGraphTester, _TestGraph):
assert G.adj == {0: {1: {}}, 1: {}}
assert G.succ == {0: {1: {}}, 1: {}}
assert G.pred == {0: {}, 1: {0: {}}}
+ with pytest.raises(ValueError, match="None cannot be a node"):
+ G.add_edge(None, 3)
def test_add_edges_from(self):
G = self.Graph()
@@ -258,6 +260,8 @@ class TestDiGraph(BaseAttrDiGraphTester, _TestGraph):
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, match="None cannot be a node"):
+ G.add_edges_from([(None, 3), (3, 2)])
def test_remove_edge(self):
G = self.K3.copy()