mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +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(
|
def stage(
|
||||||
func: Callable[
|
func: Callable[
|
||||||
[Unpack[A], T],
|
[Unpack[A], T],
|
||||||
R,
|
Optional[R],
|
||||||
],
|
],
|
||||||
):
|
):
|
||||||
"""Decorate a function to become a simple stage.
|
"""Decorate a function to become a simple stage.
|
||||||
|
|
@ -176,7 +176,7 @@ def stage(
|
||||||
[3, 4, 5]
|
[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
|
task = None
|
||||||
while True:
|
while True:
|
||||||
task = yield task
|
task = yield task
|
||||||
|
|
@ -185,7 +185,7 @@ def stage(
|
||||||
return coro
|
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
|
"""Decorate a function that manipulates items in a coroutine to
|
||||||
become a simple stage.
|
become a simple stage.
|
||||||
|
|
||||||
|
|
@ -200,7 +200,7 @@ def mutator_stage(func: Callable[[Unpack[A], T], None]):
|
||||||
[{'x': True}, {'a': False, 'x': True}]
|
[{'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
|
task = None
|
||||||
while True:
|
while True:
|
||||||
task = yield task
|
task = yield task
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
"""Tests for the 'lyrics' plugin."""
|
"""Tests for the 'lyrics' plugin."""
|
||||||
|
|
||||||
|
import importlib.util
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
@ -22,15 +24,15 @@ import pytest
|
||||||
|
|
||||||
from beets.library import Item
|
from beets.library import Item
|
||||||
from beets.test.helper import PluginMixin
|
from beets.test.helper import PluginMixin
|
||||||
|
from beetsplug import lyrics
|
||||||
try:
|
|
||||||
from beetsplug import lyrics
|
|
||||||
except Exception:
|
|
||||||
pytest.skip("lyrics plugin couldn't be loaded", allow_module_level=True)
|
|
||||||
|
|
||||||
|
|
||||||
from .lyrics_pages import LyricsPage, lyrics_pages
|
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 = {
|
PHRASE_BY_TITLE = {
|
||||||
"Lady Madonna": "friday night arrives without a suitcase",
|
"Lady Madonna": "friday night arrives without a suitcase",
|
||||||
"Jazz'n'blues": "as i check my balance i kiss the screen",
|
"Jazz'n'blues": "as i check my balance i kiss the screen",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue