Fix rebase in tests

This commit is contained in:
Brock Grassy 2026-03-13 15:31:09 -07:00 committed by Šarūnas Nejus
parent a3b7cfa1b3
commit c51f68be15

View file

@ -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)