From c51f68be154cd07af973b596bb520c262dc8e200 Mon Sep 17 00:00:00 2001 From: Brock Grassy Date: Fri, 13 Mar 2026 15:31:09 -0700 Subject: [PATCH] Fix rebase in tests --- test/plugins/test_missing.py | 63 ++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/test/plugins/test_missing.py b/test/plugins/test_missing.py index 9818a5d43..6f30d5467 100644 --- a/test/plugins/test_missing.py +++ b/test/plugins/test_missing.py @@ -11,17 +11,24 @@ from beets.library import Album, Item from beets.test.helper import IOMixin, PluginMixin, TestHelper -class TestMissingAlbums(IOMixin, PluginMixin, TestHelper): +@pytest.fixture +def helper(request): + helper = TestHelper() + helper.setup_beets() + + request.instance.lib = helper.lib + + yield + + helper.teardown_beets() + + +@pytest.mark.usefixtures("helper") +class TestMissingAlbums(IOMixin, PluginMixin): """Tests for missing albums functionality.""" plugin = "missing" - @pytest.fixture(autouse=True) - def _setup(self): - self.setup_beets() - yield - self.teardown_beets() - @pytest.mark.parametrize( "release_from_mb,expected_output", [ @@ -55,7 +62,8 @@ class TestMissingAlbums(IOMixin, PluginMixin, TestHelper): json={"release-groups": [release_from_mb]}, ) - assert self.run_with_output("missing", "--album") == expected_output + with self.configure_plugin({}): + assert self.run_with_output("missing", "--album") == expected_output def test_release_type_filters_results(self, requests_mock): """Test --release-type filters to only show specified type.""" @@ -78,9 +86,10 @@ class TestMissingAlbums(IOMixin, PluginMixin, TestHelper): }, ) - output = self.run_with_output( - "missing", "-a", "--release-type", "compilation" - ) + with self.configure_plugin({}): + output = self.run_with_output( + "missing", "-a", "--release-type", "compilation" + ) assert "artist - compilation" in output @@ -106,14 +115,15 @@ class TestMissingAlbums(IOMixin, PluginMixin, TestHelper): }, ) - output = self.run_with_output( - "missing", - "-a", - "--release-type", - "compilation", - "--release-type", - "album", - ) + with self.configure_plugin({}): + output = self.run_with_output( + "missing", + "-a", + "--release-type", + "compilation", + "--release-type", + "album", + ) assert "artist - compilation" in output assert "artist - title 2" in output @@ -140,22 +150,18 @@ class TestMissingAlbums(IOMixin, PluginMixin, TestHelper): }, ) - output = self.run_with_output("missing", "-a", "-t") + with self.configure_plugin({}): + output = self.run_with_output("missing", "-a", "-t") assert output == "1\n" -class TestMissingTracks(IOMixin, PluginMixin, TestHelper): +@pytest.mark.usefixtures("helper") +class TestMissingTracks(IOMixin, PluginMixin): """Tests for missing tracks functionality.""" plugin = "missing" - @pytest.fixture(autouse=True) - def _setup(self): - self.setup_beets() - yield - self.teardown_beets() - @pytest.mark.parametrize( "total,count,expected", [ @@ -211,4 +217,5 @@ class TestMissingTracks(IOMixin, PluginMixin, TestHelper): if count: command.append("-c") - assert expected in self.run_with_output(*command) + with self.configure_plugin({}): + assert expected in self.run_with_output(*command)