mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +01:00
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:
parent
41907a96a6
commit
6f41872a26
3 changed files with 2 additions and 13 deletions
|
|
@ -58,17 +58,12 @@ log = logging.getLogger("beets")
|
||||||
log.propagate = True
|
log.propagate = True
|
||||||
log.setLevel(logging.DEBUG)
|
log.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
# Dummy item creation.
|
|
||||||
_item_ident = 0
|
|
||||||
|
|
||||||
# OS feature test.
|
# OS feature test.
|
||||||
HAVE_SYMLINK = sys.platform != "win32"
|
HAVE_SYMLINK = sys.platform != "win32"
|
||||||
HAVE_HARDLINK = sys.platform != "win32"
|
HAVE_HARDLINK = sys.platform != "win32"
|
||||||
|
|
||||||
|
|
||||||
def item(lib=None):
|
def item(lib=None):
|
||||||
global _item_ident
|
|
||||||
_item_ident += 1
|
|
||||||
i = beets.library.Item(
|
i = beets.library.Item(
|
||||||
title="the title",
|
title="the title",
|
||||||
artist="the artist",
|
artist="the artist",
|
||||||
|
|
@ -93,7 +88,6 @@ def item(lib=None):
|
||||||
comments="the comments",
|
comments="the comments",
|
||||||
bpm=8,
|
bpm=8,
|
||||||
comp=True,
|
comp=True,
|
||||||
path=f"somepath{_item_ident}",
|
|
||||||
length=60.0,
|
length=60.0,
|
||||||
bitrate=128000,
|
bitrate=128000,
|
||||||
format="FLAC",
|
format="FLAC",
|
||||||
|
|
|
||||||
|
|
@ -713,10 +713,6 @@ class ImportSessionFixture(ImportSession):
|
||||||
|
|
||||||
default_resolution = "REMOVE"
|
default_resolution = "REMOVE"
|
||||||
|
|
||||||
def add_resolution(self, resolution):
|
|
||||||
assert isinstance(resolution, self.Resolution)
|
|
||||||
self._resolutions.append(resolution)
|
|
||||||
|
|
||||||
def resolve_duplicate(self, task, found_duplicates):
|
def resolve_duplicate(self, task, found_duplicates):
|
||||||
try:
|
try:
|
||||||
res = self._resolutions.pop(0)
|
res = self._resolutions.pop(0)
|
||||||
|
|
@ -769,12 +765,10 @@ class TerminalImportSessionFixture(TerminalImportSession):
|
||||||
self.io.addinput("T")
|
self.io.addinput("T")
|
||||||
elif choice == importer.action.SKIP:
|
elif choice == importer.action.SKIP:
|
||||||
self.io.addinput("S")
|
self.io.addinput("S")
|
||||||
elif isinstance(choice, int):
|
else:
|
||||||
self.io.addinput("M")
|
self.io.addinput("M")
|
||||||
self.io.addinput(str(choice))
|
self.io.addinput(str(choice))
|
||||||
self._add_choice_input()
|
self._add_choice_input()
|
||||||
else:
|
|
||||||
raise Exception("Unknown choice %s" % choice)
|
|
||||||
|
|
||||||
|
|
||||||
class TerminalImportMixin(ImportHelper):
|
class TerminalImportMixin(ImportHelper):
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ markers =
|
||||||
data_file = .reports/coverage/data
|
data_file = .reports/coverage/data
|
||||||
branch = true
|
branch = true
|
||||||
relative_files = true
|
relative_files = true
|
||||||
|
omit = beets/test/*
|
||||||
|
|
||||||
[coverage:report]
|
[coverage:report]
|
||||||
precision = 2
|
precision = 2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue