Incorporate _common.Assertions into helper.TestHelper

This commit is contained in:
Šarūnas Nejus 2024-07-03 11:56:15 +01:00
parent 74fee8d886
commit 2566e22744
No known key found for this signature in database
GPG key ID: DD28F6704DBE3435
3 changed files with 6 additions and 10 deletions

View file

@ -142,7 +142,7 @@ def has_program(cmd, args=["--version"]):
return True return True
class TestHelper: class TestHelper(_common.Assertions):
"""Helper mixin for high-level cli and plugin tests. """Helper mixin for high-level cli and plugin tests.
This mixin provides methods to isolate beets' global state provide This mixin provides methods to isolate beets' global state provide

View file

@ -271,7 +271,7 @@ def create_archive(session):
return path return path
class RmTempTest(unittest.TestCase, ImportHelper, _common.Assertions): class RmTempTest(unittest.TestCase, ImportHelper):
"""Tests that temporarily extracted archives are properly removed """Tests that temporarily extracted archives are properly removed
after usage. after usage.
""" """
@ -1170,9 +1170,7 @@ def match_album_mock(*args, **kwargs):
@patch("beets.autotag.mb.match_album", Mock(side_effect=match_album_mock)) @patch("beets.autotag.mb.match_album", Mock(side_effect=match_album_mock))
class ImportDuplicateAlbumTest( class ImportDuplicateAlbumTest(unittest.TestCase, TestHelper):
unittest.TestCase, TestHelper, _common.Assertions
):
def setUp(self): def setUp(self):
self.setup_beets() self.setup_beets()
@ -1294,9 +1292,7 @@ def match_track_mock(*args, **kwargs):
@patch("beets.autotag.mb.match_track", Mock(side_effect=match_track_mock)) @patch("beets.autotag.mb.match_track", Mock(side_effect=match_track_mock))
class ImportDuplicateSingletonTest( class ImportDuplicateSingletonTest(unittest.TestCase, TestHelper):
unittest.TestCase, TestHelper, _common.Assertions
):
def setUp(self): def setUp(self):
self.setup_beets() self.setup_beets()
@ -1650,7 +1646,7 @@ class MultiDiscAlbumsInDirTest(_common.TestCase):
self.assertEqual(len(items), 3) self.assertEqual(len(items), 3)
class ReimportTest(unittest.TestCase, ImportHelper, _common.Assertions): class ReimportTest(unittest.TestCase, ImportHelper):
"""Test "re-imports", in which the autotagging machinery is used for """Test "re-imports", in which the autotagging machinery is used for
music that's already in the library. music that's already in the library.

View file

@ -844,7 +844,7 @@ class ImportTest(_common.TestCase):
@_common.slow_test() @_common.slow_test()
class ConfigTest(unittest.TestCase, TestHelper, _common.Assertions): class ConfigTest(unittest.TestCase, TestHelper):
def setUp(self): def setUp(self):
self.setup_beets() self.setup_beets()