From 336b5b369eecd91cb0d4e02414218d192d31cd4b Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Mon, 25 Nov 2024 11:43:29 +0100 Subject: [PATCH] Skip autobpm tests if librosa isn't available Except under GitHub CI, where we expect all tests to run. --- test/plugins/test_autobpm.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/plugins/test_autobpm.py b/test/plugins/test_autobpm.py index b4d7005fa..6093d999f 100644 --- a/test/plugins/test_autobpm.py +++ b/test/plugins/test_autobpm.py @@ -1,7 +1,14 @@ +import importlib.util +import os + import pytest from beets.test.helper import ImportHelper, PluginMixin +github_ci = os.environ.get("GITHUB_ACTIONS") == "true" +if not github_ci and not importlib.util.find_spec("librosa"): + pytest.skip("librosa isn't available", allow_module_level=True) + class TestAutoBPMPlugin(PluginMixin, ImportHelper): plugin = "autobpm"