Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dustalov committed Oct 11, 2024
1 parent 3a588a9 commit 2df13da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ jobs:
run: chinese-whispers karate_club.tsv
- name: Lint Jupyter with Mypy
run: nbqa mypy *.ipynb
- name: Lint Jupyter with Ruff
run: nbqa ruff *.ipynb
- name: Run Jupyter
run: |
mkdir jupyter
Expand Down
10 changes: 5 additions & 5 deletions chinese_whispers/test_chinese_whispers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
from collections.abc import Collection


@pytest.fixture()
@pytest.fixture
def empty_collection() -> Collection[tuple[int, int]]:
return set()


@pytest.fixture()
@pytest.fixture
def items_collection() -> Collection[tuple[int, int]]:
return {1: 3, 2: 1, 3: 2, 4: 3}.items()

Expand All @@ -35,7 +35,7 @@ def test_random_argmax_items(items_collection: Collection[tuple[int, int]]) -> N
assert random_argmax(items_collection, Random(2).choice) == 1


@pytest.fixture()
@pytest.fixture
def graph() -> nx.Graph[int]:
graph = nx.karate_club_graph()

Expand All @@ -45,15 +45,15 @@ def graph() -> nx.Graph[int]:
return cast("nx.Graph[int]", graph)


@pytest.fixture()
@pytest.fixture
def clustered_graph(graph: nx.Graph[int]) -> nx.Graph[int]:
return chinese_whispers(graph, seed=0)


CUSTOM_KEY = "cluster_id"


@pytest.fixture()
@pytest.fixture
def clustered_graph_custom_key(graph: nx.Graph[int]) -> nx.Graph[int]:
return chinese_whispers(graph, seed=0, label_key=CUSTOM_KEY)

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
Expand Down

0 comments on commit 2df13da

Please sign in to comment.