Skip to content

Commit

Permalink
fix: failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
dPys committed Dec 25, 2024
1 parent 072b145 commit e76e0e0
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions nxbench/benchmarking/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import random
import tracemalloc
from importlib.metadata import PackageNotFoundError
from unittest.mock import MagicMock, patch

import numpy as np
Expand Down Expand Up @@ -436,27 +435,6 @@ def test_add_seeding(algo_func, kwargs_in, expected_kwargs):
pass


def test_get_available_backends_package_not_found():
"""
Test scenario where a backend module import succeeds, but get_version
raises PackageNotFoundError. We should gracefully skip version retrieval.
"""
mock_networkx_module = type("MockNetworkX", (), {})() # no __version__

with (
patch(
"nxbench.benchmarking.utils.importlib.import_module",
return_value=mock_networkx_module,
),
patch(
"nxbench.benchmarking.utils.get_version",
side_effect=PackageNotFoundError("networkx not found"),
),
):
backends = get_available_backends()
assert "networkx" not in backends


def test_add_seeding_non_int_seed():
"""
Test that if the 'seed' in kwargs is non-integer, no global seeds
Expand Down

0 comments on commit e76e0e0

Please sign in to comment.