diff --git a/tests/test_cli.py b/tests/test_cli.py index 3fc048585..00f33bb1c 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1522,7 +1522,7 @@ def test_annotate_file(self): ], ) print("STDERR", result.stdout) - err = result.stderr + err = "\n".join([line for line in result.stderr.split("\n") if not line.startswith("WARNING")]) self.assertEqual("", err) self.assertEqual(0, result.exit_code) with open(outfile) as stream: diff --git a/tests/test_implementations/test_semsimian_implementation.py b/tests/test_implementations/test_semsimian_implementation.py index fb1e32973..ce06b4857 100644 --- a/tests/test_implementations/test_semsimian_implementation.py +++ b/tests/test_implementations/test_semsimian_implementation.py @@ -1,6 +1,7 @@ import os import timeit import unittest +from importlib.util import find_spec from linkml_runtime.dumpers import yaml_dumper @@ -31,6 +32,7 @@ @unittest.skipIf(os.name == "nt", "DB path loading inconsistent on Windows") +@unittest.skipIf(find_spec("semsimian") is None, "Semsimian not available") class TestSemSimianImplementation(unittest.TestCase): """Implementation tests for Rust-based semantic similarity.""" diff --git a/tests/test_selector.py b/tests/test_selector.py index 35cb52364..ca75da5e8 100644 --- a/tests/test_selector.py +++ b/tests/test_selector.py @@ -6,8 +6,13 @@ import unittest from pathlib import Path -from gilda.grounder import Grounder -from gilda.term import Term +try: + from gilda.grounder import Grounder + from gilda.term import Term + + have_gilda = True +except ImportError: + have_gilda = False from oaklib.datamodels.text_annotator import TextAnnotationConfiguration from oaklib.implementations.gilda import GildaImplementation @@ -23,6 +28,7 @@ from tests import INPUT_DIR +@unittest.skipIf(not have_gilda, "Gilda not available") class TestResource(unittest.TestCase): def test_from_descriptor(self): # no scheme