Skip to content

Commit d72248b

Browse files
committed
fix bug in test
1 parent 4b5d41a commit d72248b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

python/cugraph/cugraph/tests/structure/test_multigraph.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2024, NVIDIA CORPORATION.
1+
# Copyright (c) 2020-2025, NVIDIA CORPORATION.
22
# Licensed under the Apache License, Version 2.0 (the "License");
33
# you may not use this file except in compliance with the License.
44
# You may obtain a copy of the License at
@@ -63,6 +63,7 @@ def test_multigraph(graph_file):
6363
@pytest.mark.parametrize("graph_file", DEFAULT_DATASETS)
6464
def test_Graph_from_MultiGraph(graph_file):
6565
# FIXME: Migrate to new test fixtures for Graph setup once available
66+
# Test undirected Multigraph
6667
GM = graph_file.get_graph(create_using=cugraph.MultiGraph())
6768
dataset_path = graph_file.get_path()
6869
nxM = utils.read_csv_for_nx(dataset_path, read_weights_in_sp=True)
@@ -76,7 +77,9 @@ def test_Graph_from_MultiGraph(graph_file):
7677

7778
G = cugraph.Graph(GM)
7879
Gnx = nx.Graph(GnxM)
79-
assert Gnx.number_of_edges() == G.number_of_edges(directed_edges=True)
80+
assert Gnx.number_of_edges() == G.number_of_edges(directed_edges=False)
81+
82+
# Test directed Multigraph
8083
GdM = graph_file.get_graph(create_using=cugraph.MultiGraph(directed=True))
8184
GnxdM = nx.from_pandas_edgelist(
8285
nxM,
@@ -87,7 +90,7 @@ def test_Graph_from_MultiGraph(graph_file):
8790
)
8891
Gd = cugraph.Graph(GdM, directed=True)
8992
Gnxd = nx.DiGraph(GnxdM)
90-
assert Gnxd.number_of_edges() == Gd.number_of_edges()
93+
assert Gnxd.number_of_edges() == Gd.number_of_edges(directed_edges=True)
9194

9295

9396
@pytest.mark.sg

0 commit comments

Comments
 (0)