Skip to content

Commit 6f41872

Browse files
committed
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.
1 parent 41907a9 commit 6f41872

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

beets/test/_common.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,12 @@
5858
log.propagate = True
5959
log.setLevel(logging.DEBUG)
6060

61-
# Dummy item creation.
62-
_item_ident = 0
63-
6461
# OS feature test.
6562
HAVE_SYMLINK = sys.platform != "win32"
6663
HAVE_HARDLINK = sys.platform != "win32"
6764

6865

6966
def item(lib=None):
70-
global _item_ident
71-
_item_ident += 1
7267
i = beets.library.Item(
7368
title="the title",
7469
artist="the artist",
@@ -93,7 +88,6 @@ def item(lib=None):
9388
comments="the comments",
9489
bpm=8,
9590
comp=True,
96-
path=f"somepath{_item_ident}",
9791
length=60.0,
9892
bitrate=128000,
9993
format="FLAC",

beets/test/helper.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,6 @@ def choose_match(self, task):
713713

714714
default_resolution = "REMOVE"
715715

716-
def add_resolution(self, resolution):
717-
assert isinstance(resolution, self.Resolution)
718-
self._resolutions.append(resolution)
719-
720716
def resolve_duplicate(self, task, found_duplicates):
721717
try:
722718
res = self._resolutions.pop(0)
@@ -769,12 +765,10 @@ def _add_choice_input(self):
769765
self.io.addinput("T")
770766
elif choice == importer.action.SKIP:
771767
self.io.addinput("S")
772-
elif isinstance(choice, int):
768+
else:
773769
self.io.addinput("M")
774770
self.io.addinput(str(choice))
775771
self._add_choice_input()
776-
else:
777-
raise Exception("Unknown choice %s" % choice)
778772

779773

780774
class TerminalImportMixin(ImportHelper):

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ markers =
1414
data_file = .reports/coverage/data
1515
branch = true
1616
relative_files = true
17+
omit = beets/test/*
1718

1819
[coverage:report]
1920
precision = 2

0 commit comments

Comments
 (0)