tests: address some warnings

- some helper functions were incorrectly detected as being tests due to
  their name
- use of the deprecated assertEquals alias
This commit is contained in:
wisp3rwind 2023-05-04 09:12:41 +02:00
parent 6f0d305489
commit 5de1d12610
2 changed files with 6 additions and 6 deletions

View file

@ -1221,7 +1221,7 @@ class InferAlbumDataTest(_common.TestCase):
self.assertFalse(self.items[0].comp)
def test_album_info(*args, **kwargs):
def match_album_mock(*args, **kwargs):
"""Create an AlbumInfo object for testing.
"""
track_info = TrackInfo(
@ -1240,7 +1240,7 @@ def test_album_info(*args, **kwargs):
return iter([album_info])
@patch('beets.autotag.mb.match_album', Mock(side_effect=test_album_info))
@patch('beets.autotag.mb.match_album', Mock(side_effect=match_album_mock))
class ImportDuplicateAlbumTest(unittest.TestCase, TestHelper,
_common.Assertions):
@ -1349,13 +1349,13 @@ class ImportDuplicateAlbumTest(unittest.TestCase, TestHelper,
return album
def test_track_info(*args, **kwargs):
def match_track_mock(*args, **kwargs):
return iter([TrackInfo(
artist='artist', title='title',
track_id='new trackid', index=0,)])
@patch('beets.autotag.mb.match_track', Mock(side_effect=test_track_info))
@patch('beets.autotag.mb.match_track', Mock(side_effect=match_track_mock))
class ImportDuplicateSingletonTest(unittest.TestCase, TestHelper,
_common.Assertions):

View file

@ -77,12 +77,12 @@ class M3UFileTest(unittest.TestCase):
self.assertTrue(path.exists(the_playlist_file))
m3ufile_read = M3UFile(the_playlist_file)
m3ufile_read.load()
self.assertEquals(
self.assertEqual(
m3ufile.media_list[0],
bytestring_path(
path.join('x:\\', 'This', 'is', 'å', 'path', 'to_a_file.mp3'))
)
self.assertEquals(
self.assertEqual(
m3ufile.media_list[1],
bytestring_path(r"x:\This\is\another\path\tö_a_file.mp3"),
bytestring_path(path.join(