Skip to content

Commit a1be9b5

Browse files
authored
Merge pull request #140 from mdevolde/CI_BUG
fix: patched a bug of consistency in CI (CI got frozen)
2 parents e6b6b99 + 46a1071 commit a1be9b5

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
branches: [ master ]
99
pull_request:
1010
branches: [ master ]
11+
workflow_dispatch:
1112

1213
jobs:
1314
tests:
@@ -38,7 +39,7 @@ jobs:
3839

3940
- name: Install dependencies & build package
4041
run: |
41-
uv pip install setuptools wheel build pytest pytest-cov pytest-rerunfailures pytest-xdist --system
42+
uv pip install setuptools wheel build pytest pytest-cov --system
4243
uv build
4344
uv pip install dist/*.whl --system
4445
@@ -52,7 +53,7 @@ jobs:
5253
5354
- name: Test with pytest
5455
run: |
55-
pytest --dist=loadfile -n auto
56+
pytest
5657
5758
lint:
5859
name: Lint with Ruff

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ changelog = "https://github.com/jxmorris12/language_tool_python/blob/master/CHAN
4242
[dependency-groups]
4343
tests = [
4444
"pytest",
45-
"pytest-xdist",
4645
"pytest-cov",
47-
"pytest-rerunfailures",
48-
"pytest-runner"
4946
]
5047

5148
docs = [

tests/test_api_public.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
"""Tests for the public API functionality."""
22

3-
import os
4-
53
import pytest
64

75
from language_tool_python.exceptions import RateLimitError
86

9-
pytestmark = pytest.mark.skipif(
10-
os.getenv("GITHUB_ACTIONS") == "true",
11-
reason="Skip public API test on CI (depends on external service).",
12-
)
13-
147

158
def test_remote_es() -> None:
169
"""
@@ -31,5 +24,4 @@ def test_remote_es() -> None:
3124
== """[Match({'rule_id': 'AFRENTAR_DIFICULTADES', 'message': 'Confusión entre «afrontar» y «afrentar».', 'replacements': ['afrontar'], 'offset_in_context': 43, 'context': '...n texto aquí. LanguageTool le ayudará a afrentar algunas dificultades propias de la escr...', 'offset': 49, 'error_length': 8, 'category': 'INCORRECT_EXPRESSIONS', 'rule_issue_type': 'grammar', 'sentence': 'LanguageTool le ayudará a afrentar algunas dificultades propias de la escritura.'}), Match({'rule_id': 'PRON_HABER_PARTICIPIO', 'message': 'El v. ‘haber’ se escribe con hache.', 'replacements': ['ha'], 'offset_in_context': 43, 'context': '...ificultades propias de la escritura. Se a hecho un esfuerzo para detectar errores...', 'offset': 107, 'error_length': 1, 'category': 'MISSPELLING', 'rule_issue_type': 'misspelling', 'sentence': 'Se a hecho un esfuerzo para detectar errores tipográficos, ortograficos y incluso gramaticales.'}), Match({'rule_id': 'MORFOLOGIK_RULE_ES', 'message': 'Se ha encontrado un posible error ortográfico.', 'replacements': ['ortográficos', 'ortográficas', 'ortográfico', 'orográficos', 'ortografiaos', 'ortografíeos'], 'offset_in_context': 43, 'context': '...rzo para detectar errores tipográficos, ortograficos y incluso gramaticales. También algunos...', 'offset': 163, 'error_length': 12, 'category': 'TYPOS', 'rule_issue_type': 'misspelling', 'sentence': 'Se a hecho un esfuerzo para detectar errores tipográficos, ortograficos y incluso gramaticales.'}), Match({'rule_id': 'Y_E_O_U', 'message': 'Cuando precede a palabras que comienzan por ‘i’, la conjunción ‘y’ se transforma en ‘e’.', 'replacements': ['e'], 'offset_in_context': 43, 'context': '...ctar errores tipográficos, ortograficos y incluso gramaticales. También algunos e...', 'offset': 176, 'error_length': 1, 'category': 'GRAMMAR', 'rule_issue_type': 'grammar', 'sentence': 'Se a hecho un esfuerzo para detectar errores tipográficos, ortograficos y incluso gramaticales.'}), Match({'rule_id': 'GROSSO_MODO', 'message': 'Esta expresión latina se usa sin preposición.', 'replacements': ['grosso modo'], 'offset_in_context': 43, 'context': '...les. También algunos errores de estilo, a grosso modo.', 'offset': 235, 'error_length': 13, 'category': 'GRAMMAR', 'rule_issue_type': 'grammar', 'sentence': 'También algunos errores de estilo, a grosso modo.'})]"""
3225
)
3326
except RateLimitError:
34-
print("Rate limit error: skipping test about public API.")
35-
return
27+
pytest.skip("Rate limit exceeded for public API.")

tests/test_match.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
from typing import Any, Dict, List
44

5-
import pytest
65

7-
8-
@pytest.mark.flaky(reruns=2) # type: ignore[misc] # Sometimes LT throws NoClassDefFoundError (500)
96
def test_langtool_load() -> None:
107
"""
118
Test the basic functionality of LanguageTool and Match object attributes.

0 commit comments

Comments
 (0)