diff --git a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py index 13d319e7b3c..3da33a3e853 100644 --- a/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py +++ b/python/cugraph/cugraph/tests/link_prediction/test_sorensen.py @@ -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 @@ -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 @@ -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) @@ -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) diff --git a/python/cugraph/cugraph/tests/utils/test_dataset.py b/python/cugraph/cugraph/tests/utils/test_dataset.py index 326c6814003..e58f697e82f 100644 --- a/python/cugraph/cugraph/tests/utils/test_dataset.py +++ b/python/cugraph/cugraph/tests/utils/test_dataset.py @@ -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 ( @@ -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() \ No newline at end of file