Remove unused logic from beets.test and exclude it from coverage

Fun fact: it was the coverage data that revealed that this logic is not
used.
This commit is contained in:
Šarūnas Nejus 2024-10-16 12:38:21 +01:00
parent 41907a96a6
commit 6f41872a26
No known key found for this signature in database
GPG key ID: DD28F6704DBE3435
3 changed files with 2 additions and 13 deletions

View file

@ -58,17 +58,12 @@ log = logging.getLogger("beets")
log.propagate = True
log.setLevel(logging.DEBUG)
# Dummy item creation.
_item_ident = 0
# OS feature test.
HAVE_SYMLINK = sys.platform != "win32"
HAVE_HARDLINK = sys.platform != "win32"
def item(lib=None):
global _item_ident
_item_ident += 1
i = beets.library.Item(
title="the title",
artist="the artist",
@ -93,7 +88,6 @@ def item(lib=None):
comments="the comments",
bpm=8,
comp=True,
path=f"somepath{_item_ident}",
length=60.0,
bitrate=128000,
format="FLAC",

View file

@ -713,10 +713,6 @@ class ImportSessionFixture(ImportSession):
default_resolution = "REMOVE"
def add_resolution(self, resolution):
assert isinstance(resolution, self.Resolution)
self._resolutions.append(resolution)
def resolve_duplicate(self, task, found_duplicates):
try:
res = self._resolutions.pop(0)
@ -769,12 +765,10 @@ class TerminalImportSessionFixture(TerminalImportSession):
self.io.addinput("T")
elif choice == importer.action.SKIP:
self.io.addinput("S")
elif isinstance(choice, int):
else:
self.io.addinput("M")
self.io.addinput(str(choice))
self._add_choice_input()
else:
raise Exception("Unknown choice %s" % choice)
class TerminalImportMixin(ImportHelper):

View file

@ -14,6 +14,7 @@ markers =
data_file = .reports/coverage/data
branch = true
relative_files = true
omit = beets/test/*
[coverage:report]
precision = 2