Merge remote-tracking branch 'upstream/master' into spotify_retry

This commit is contained in:
Alok Saboo 2023-10-21 16:16:31 -04:00
commit b9da57481f
3 changed files with 14 additions and 21 deletions

View file

@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.x', '3.12-dev']
python-version: ['3.7', '3.8', '3.9', '3.x']
env:
PY_COLORS: 1
@ -45,7 +45,7 @@ jobs:
sudo apt install ffmpeg # For replaygain
- name: Test older Python versions with tox
if: matrix.python-version != '3.x' && matrix.python-version != '3.12-dev'
if: matrix.python-version != '3.x'
run: |
tox -e py-test
@ -63,15 +63,6 @@ jobs:
run: |
tox -vv -e py-mypy
- name: Test nightly Python version with tox
if: matrix.python-version == '3.12-dev'
# continue-on-error is not ideal since it doesn't give a visible
# warning, but there doesn't seem to be anything better:
# https://github.com/actions/toolkit/issues/399
continue-on-error: true
run: |
tox -e py-test
- name: Upload code coverage
if: matrix.python-version == '3.x'
run: |

View file

@ -135,9 +135,6 @@ class ThumbnailsTest(unittest.TestCase, TestHelper):
plugin.make_cover_thumbnail(album, 12345, thumbnail_dir)
mock_os.path.exists.assert_called_once_with(syspath(md5_file))
mock_os.stat.has_calls([call(syspath(md5_file)),
call(syspath(path_to_art))],
any_order=True)
mock_resize.assert_called_once_with(12345, path_to_art, md5_file)
plugin.add_tags.assert_called_once_with(album, path_to_resized_art)
@ -230,8 +227,9 @@ class ThumbnailsTest(unittest.TestCase, TestHelper):
make_cover.reset_mock()
get_size.return_value = 500, 500
plugin.process_album(album)
make_cover.has_calls([call(album, 128, NORMAL_DIR),
call(album, 256, LARGE_DIR)], any_order=True)
make_cover.assert_has_calls([call(album, 128, NORMAL_DIR),
call(album, 256, LARGE_DIR)],
any_order=True)
@patch('beetsplug.thumbnails.ThumbnailsPlugin._check_local_ok')
@patch('beetsplug.thumbnails.decargs')
@ -246,8 +244,8 @@ class ThumbnailsTest(unittest.TestCase, TestHelper):
lib.albums.return_value = [album, album2]
plugin.process_query(lib, Mock(), None)
lib.albums.assert_called_once_with(mock_decargs.return_value)
plugin.process_album.has_calls([call(album), call(album2)],
any_order=True)
plugin.process_album.assert_has_calls([call(album), call(album2)],
any_order=True)
@patch('beetsplug.thumbnails.BaseDirectory')
def test_thumbnail_file_name(self, mock_basedir):

View file

@ -321,9 +321,13 @@ class ListenersTest(unittest.TestCase, TestHelper):
[d.dummy, d2.dummy])
@patch('beets.plugins.find_plugins')
@patch('beets.plugins.inspect')
def test_events_called(self, mock_inspect, mock_find_plugins):
mock_inspect.getargspec.args.return_value = None
@patch('inspect.getfullargspec')
def test_events_called(self, mock_gfa, mock_find_plugins):
mock_gfa.return_value = Mock(
args=(),
varargs='args',
varkw='kwargs',
)
class DummyPlugin(plugins.BeetsPlugin):
def __init__(self):