Skip to content

Commit

Permalink
Merge pull request #5 from nv-rliu/branch-23.08
Browse files Browse the repository at this point in the history
Update remove-nx-suppression-warnings branch to include changes from branch-23.08
  • Loading branch information
nv-rliu authored Jul 20, 2023
2 parents 0ed5a7f + 144a039 commit baa8102
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
8 changes: 4 additions & 4 deletions python/cugraph/cugraph/tests/link_prediction/test_sorensen.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import cudf
import cugraph
from cugraph.testing import utils, UNDIRECTED_DATASETS
from cugraph.datasets import netscience
from cugraph.testing import utils, DATASETS_UNDIRECTED
from cugraph.experimental import sorensen as exp_sorensen
from cudf.testing import assert_series_equal, assert_frame_equal

Expand Down Expand Up @@ -135,7 +135,7 @@ def networkx_call(M, benchmark_callable=None):
# =============================================================================
# Pytest Fixtures
# =============================================================================
@pytest.fixture(scope="module", params=DATASETS_UNDIRECTED)
@pytest.fixture(scope="module", params=UNDIRECTED_DATASETS)
def read_csv(request):
"""
Read csv file for both networkx and cugraph
Expand Down Expand Up @@ -270,7 +270,7 @@ def test_sorensen_multi_column(read_csv):

@pytest.mark.sg
def test_weighted_exp_sorensen():
karate = DATASETS_UNDIRECTED[0]
karate = UNDIRECTED_DATASETS[0]
G = karate.get_graph()
with pytest.raises(ValueError):
exp_sorensen(G)
Expand All @@ -283,7 +283,7 @@ def test_weighted_exp_sorensen():

@pytest.mark.sg
def test_invalid_datasets_sorensen():
karate = DATASETS_UNDIRECTED[0]
karate = UNDIRECTED_DATASETS[0]
df = karate.get_edgelist()
df = df.add(1)
G = cugraph.Graph(directed=False)
Expand Down
26 changes: 20 additions & 6 deletions python/cugraph/cugraph/tests/utils/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,18 +266,20 @@ def test_is_directed(dataset):

assert G.is_directed() == dataset.metadata["is_directed"]


#
# Test experimental for DeprecationWarnings
#
def test_experimental_dataset_import():
warnings.filterwarnings("default")

with pytest.deprecated_call() as record:
from cugraph.experimental.datasets import karate

if not record:
pytest.fail("Expected experimental.datasets to raise DeprecationWarning")

karate.unload()

assert len(record) == 15


def test_experimental_method_warnings():
from cugraph.experimental.datasets import (
Expand All @@ -288,11 +290,23 @@ def test_experimental_method_warnings():

warnings.filterwarnings("default")
tmpd = TemporaryDirectory()

with pytest.deprecated_call() as record:
set_download_dir(tmpd.name)
load_all()

if not record:
pytest.fail("Expected set_download_dir to raise DeprecationWarning")

with pytest.deprecated_call() as record:
get_download_dir()

assert len(record) == 3
if not record:
pytest.fail("Expected get_download_dir to raise DeprecationWarning")

with pytest.deprecated_call() as record:
load_all()

if not record:
pytest.fail("Expected load_all to raise DeprecationWarning")

tmpd.cleanup()
tmpd.cleanup()

0 comments on commit baa8102

Please sign in to comment.