mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +01:00
Do not skip tests in ci.
The return type of the stage decorator should in theory be `T|None` but the return of task types is not consistent in its usage. Would need some bigger changes for which I'm not ready at the moment.
This commit is contained in:
parent
04aa1b8ddb
commit
ed92f9b997
2 changed files with 12 additions and 10 deletions
|
|
@ -160,7 +160,7 @@ R = TypeVar("R")
|
|||
def stage(
|
||||
func: Callable[
|
||||
[Unpack[A], T],
|
||||
R,
|
||||
Optional[R],
|
||||
],
|
||||
):
|
||||
"""Decorate a function to become a simple stage.
|
||||
|
|
@ -176,7 +176,7 @@ def stage(
|
|||
[3, 4, 5]
|
||||
"""
|
||||
|
||||
def coro(*args: Unpack[A]) -> Generator[Union[R, T, None], T, None]:
|
||||
def coro(*args: Unpack[A]) -> Generator[Union[R, T, None], T, R]:
|
||||
task = None
|
||||
while True:
|
||||
task = yield task
|
||||
|
|
@ -185,7 +185,7 @@ def stage(
|
|||
return coro
|
||||
|
||||
|
||||
def mutator_stage(func: Callable[[Unpack[A], T], None]):
|
||||
def mutator_stage(func: Callable[[Unpack[A], T], R]):
|
||||
"""Decorate a function that manipulates items in a coroutine to
|
||||
become a simple stage.
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ def mutator_stage(func: Callable[[Unpack[A], T], None]):
|
|||
[{'x': True}, {'a': False, 'x': True}]
|
||||
"""
|
||||
|
||||
def coro(*args: Unpack[A]) -> Generator[Optional[T], T, None]:
|
||||
def coro(*args: Unpack[A]) -> Generator[Union[T, None], T, None]:
|
||||
task = None
|
||||
while True:
|
||||
task = yield task
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
"""Tests for the 'lyrics' plugin."""
|
||||
|
||||
import importlib.util
|
||||
import os
|
||||
import re
|
||||
from functools import partial
|
||||
from http import HTTPStatus
|
||||
|
|
@ -22,15 +24,15 @@ import pytest
|
|||
|
||||
from beets.library import Item
|
||||
from beets.test.helper import PluginMixin
|
||||
|
||||
try:
|
||||
from beetsplug import lyrics
|
||||
except Exception:
|
||||
pytest.skip("lyrics plugin couldn't be loaded", allow_module_level=True)
|
||||
|
||||
from beetsplug import lyrics
|
||||
|
||||
from .lyrics_pages import LyricsPage, lyrics_pages
|
||||
|
||||
github_ci = os.environ.get("GITHUB_ACTIONS") == "true"
|
||||
if not github_ci and not importlib.util.find_spec("langdetect"):
|
||||
pytest.skip("langdetect isn't available", allow_module_level=True)
|
||||
|
||||
|
||||
PHRASE_BY_TITLE = {
|
||||
"Lady Madonna": "friday night arrives without a suitcase",
|
||||
"Jazz'n'blues": "as i check my balance i kiss the screen",
|
||||
|
|
|
|||
Loading…
Reference in a new issue