From 5073d26cc80b1153470f2da6d28b8b98e3c952a2 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Tue, 21 Jan 2025 22:50:06 +0100 Subject: [PATCH] Update tests --- tests/test_api.py | 12 +++++++----- tox.ini | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 8913eedc..310549f5 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,5 +1,6 @@ """Tests for alternative identifiers.""" +import importlib.util import unittest from contextlib import ExitStack from unittest import mock @@ -214,11 +215,12 @@ def test_api(self) -> None: ] self.assertEqual(expected, literal_mappings) - grounder = get_grounder(TEST_P1) - scored_match = grounder.ground_best(syn1) - self.assertIsNotNone(scored_match) - self.assertEqual(TEST_P1, scored_match.term.db) - self.assertEqual("1", scored_match.term.id) + if importlib.util.find_spec("gilda"): + grounder = get_grounder(TEST_P1) + scored_match = grounder.ground_best(syn1) + self.assertIsNotNone(scored_match) + self.assertEqual(TEST_P1, scored_match.term.db) + self.assertEqual("1", scored_match.term.id) # Properties diff --git a/tox.ini b/tox.ini index fe9d193f..41e9d049 100644 --- a/tox.ini +++ b/tox.ini @@ -45,7 +45,6 @@ commands = extras = # See the [project.optional-dependencies] entry in pyproject.toml for "tests" tests - grounding set_env = # this setting gets inherited into all environments, meaning # that things that call uv commands don't require a --preview