-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip autobpm tests if librosa isn't available #5516
Conversation
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
0c9667a
to
cdd9c66
Compare
Does this fix the issue for you? I'd be surprised if it does - |
Ah, I misunderstood |
cdd9c66
to
3669372
Compare
3669372
to
19004a5
Compare
test/plugins/test_autobpm.py
Outdated
import pytest | ||
|
||
from beets.test.helper import ImportHelper, PluginMixin | ||
|
||
if not importlib.util.find_spec("librosa"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I initially thought 'why not simple import librosa
in a try catch block' but why import it if it's not required in this module.
Note that we always want to run these tests in CI: after this change, if librosa installation was accidentally removed from the CI, these tests would be skipped silently,
See test_lyrics.py for an example condition which checks whether tests are being run in CI or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. I initially thought 'why not simple import librosa in a try catch block' but why import it if it's not required in this module.
I had that, and the CI told me not to do it that way :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the good ol' F401
Except under GitHub CI, where we expect all tests to run.
19004a5
to
336b5b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done, thanks!
Description
Debian doesn't have
librosa
. Allow the tests to continue.