Skip to content

Commit

Permalink
Remove unused logic from beets.test and exclude it from coverage
Browse files Browse the repository at this point in the history
Fun fact: it was the coverage data that revealed that this logic is not
used.
  • Loading branch information
snejus committed Oct 16, 2024
1 parent 41907a9 commit 6f41872
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
6 changes: 0 additions & 6 deletions beets/test/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,12 @@
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",
Expand All @@ -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",
Expand Down
8 changes: 1 addition & 7 deletions beets/test/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,6 @@ def choose_match(self, task):

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)
Expand Down Expand Up @@ -769,12 +765,10 @@ def _add_choice_input(self):
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):
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ markers =
data_file = .reports/coverage/data
branch = true
relative_files = true
omit = beets/test/*

[coverage:report]
precision = 2
Expand Down

0 comments on commit 6f41872

Please sign in to comment.