From 2df13dadda851412a86029daa264ace2476949ec Mon Sep 17 00:00:00 2001 From: Dmitry Ustalov Date: Fri, 11 Oct 2024 17:33:01 +0200 Subject: [PATCH] Fix tests --- .github/workflows/test.yml | 2 -- chinese_whispers/test_chinese_whispers.py | 10 +++++----- pyproject.toml | 1 + 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab53759..c54da50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/chinese_whispers/test_chinese_whispers.py b/chinese_whispers/test_chinese_whispers.py index 76afc9e..df4389c 100755 --- a/chinese_whispers/test_chinese_whispers.py +++ b/chinese_whispers/test_chinese_whispers.py @@ -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() @@ -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() @@ -45,7 +45,7 @@ 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) @@ -53,7 +53,7 @@ def clustered_graph(graph: nx.Graph[int]) -> nx.Graph[int]: 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) diff --git a/pyproject.toml b/pyproject.toml index ee468bf..ce3729e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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",