diff options
author | Alimi Qudirah <qudrohbidemi@gmail.com> | 2022-10-27 08:52:22 +0100 |
---|---|---|
committer | Jarrod Millman <jarrod.millman@gmail.com> | 2022-11-01 10:28:29 -0700 |
commit | 15e6211c3d3d5c79e3a294c8abf9fcae0c2f5330 (patch) | |
tree | b4d3650542a1f05f053a1b4f5312470bc3f4f35b | |
parent | 3abf9b8ac162a64e047dd00f3a0c87ebf5e3c9f4 (diff) | |
download | networkx-15e6211c3d3d5c79e3a294c8abf9fcae0c2f5330.tar.gz |
Improve test coverage for digraph class (#6130)
* fixes #6036
* test load centrality
* test dispersion
* test dispersion
* dispersion test
* test dispersion
* bug-fixes-for-issue-6088
* deleted
* bugfix for issue 6109
* deleting unrelated commits
-rw-r--r-- | networkx/classes/tests/test_digraph.py | 4 |
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() |