summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOkite chimaobi Samuel <okitesamuel28@gmail.com>2022-10-17 16:54:08 +0100
committerJarrod Millman <jarrod.millman@gmail.com>2022-11-01 10:27:41 -0700
commit5f3b11aafa93690ebfac7cd227ca4633430000ed (patch)
tree1caef542f15314450cde64886c7b632f8cad45dd
parent984421bfd44328f1cd51735e3700b78a583476c4 (diff)
downloadnetworkx-5f3b11aafa93690ebfac7cd227ca4633430000ed.tar.gz
Improve test coverage expanders line graph generators solved (PR for issue #6034) (#6071)
* updated test coverage for issue 6034 * updated test to included nx.MultiGraph
-rw-r--r--networkx/generators/tests/test_expanders.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/networkx/generators/tests/test_expanders.py b/networkx/generators/tests/test_expanders.py
index 58f6b1b8..f84b04a7 100644
--- a/networkx/generators/tests/test_expanders.py
+++ b/networkx/generators/tests/test_expanders.py
@@ -64,9 +64,24 @@ def test_paley_graph(p):
assert (v, u) in G.edges
-@pytest.mark.parametrize("graph_type", (nx.Graph, nx.DiGraph))
+@pytest.mark.parametrize("graph_type", (nx.Graph, nx.DiGraph, nx.MultiDiGraph))
def test_margulis_gabber_galil_graph_badinput(graph_type):
with pytest.raises(
nx.NetworkXError, match="`create_using` must be an undirected multigraph"
):
nx.margulis_gabber_galil_graph(3, create_using=graph_type)
+
+
+@pytest.mark.parametrize("graph_type", (nx.Graph, nx.DiGraph, nx.MultiDiGraph))
+def test_chordal_cycle_graph_badinput(graph_type):
+ with pytest.raises(
+ nx.NetworkXError, match="`create_using` must be an undirected multigraph"
+ ):
+ nx.chordal_cycle_graph(3, create_using=graph_type)
+
+
+def test_paley_graph_badinput():
+ with pytest.raises(
+ nx.NetworkXError, match="`create_using` cannot be a multigraph."
+ ):
+ nx.paley_graph(3, create_using=nx.MultiGraph)