Skip to content

Commit 0a45896

Browse files
authored
[Inner loop] Require langdetect when running tests (#5801)
Fixes #5797. Today, local tests (`poe test`) will fail to run if `langdetect` is not installed. This change makes `langdetect` required for test runs. Although this is easy to resolve with `poetry install --all-extras`, the code intends to work without that; it's a worthwhile fix.
2 parents 87701fd + 2f98f11 commit 0a45896

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Bug fixes:
3535
event to be sent twice, not once.
3636
:bug:`5560`
3737
* Fix ``HiddenFileTest`` by using ``bytestring_path()``.
38+
* tests: Fix tests failing without ``langdetect`` (by making it required).
39+
:bug:`5797`
3840

3941
For packagers:
4042

poetry.lock

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ sphinx = { version = "*", optional = true }
8484
beautifulsoup4 = "*"
8585
codecov = ">=2.1.13"
8686
flask = "*"
87+
langdetect = "*"
8788
mock = "*"
8889
pylast = "*"
8990
pytest = "*"

test/plugins/test_lyrics.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
"""Tests for the 'lyrics' plugin."""
1616

17-
import importlib.util
18-
import os
1917
import re
2018
import textwrap
2119
from functools import partial
@@ -30,11 +28,6 @@
3028

3129
from .lyrics_pages import LyricsPage, lyrics_pages
3230

33-
github_ci = os.environ.get("GITHUB_ACTIONS") == "true"
34-
if not github_ci and not importlib.util.find_spec("langdetect"):
35-
pytest.skip("langdetect isn't available", allow_module_level=True)
36-
37-
3831
PHRASE_BY_TITLE = {
3932
"Lady Madonna": "friday night arrives without a suitcase",
4033
"Jazz'n'blues": "as i check my balance i kiss the screen",

0 commit comments

Comments
 (0)