summaryrefslogtreecommitdiff
path: root/networkx/generators
diff options
context:
space:
mode:
authorOkite chimaobi Samuel <okitesamuel28@gmail.com>2022-10-17 16:54:08 +0100
committerGitHub <noreply@github.com>2022-10-18 00:54:08 +0900
commitbcf607cf7ce4009ca37786b2fcd84e548f1833f5 (patch)
treebe8a2f35ca178b68763b57775c9132604ec11e68 /networkx/generators
parent4c9f628a6187c43f0de20aa9a39cc5ff0bc57001 (diff)
downloadnetworkx-bcf607cf7ce4009ca37786b2fcd84e548f1833f5.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
Diffstat (limited to 'networkx/generators')
-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)