cleanup: drop redundant @pytest.mark.asyncio + fix log_id type

- pyproject already sets asyncio_mode=auto, so async def tests are
  collected as async automatically. Removed the redundant decorator
  from four files (test_i18n, test_llm_csv_parser, test_ticker_validate,
  test_localization_integration); the bare async def is enough.
- StrategicLogTranslation.log_id used the _PK autoincrement type for
  a non-PK FK column. Replaced with a portable BigInteger that emits
  Integer on SQLite and BigInteger elsewhere — matches the migration's
  sa.BigInteger() declaration.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Giorgio Gilestro 2026-05-27 19:32:38 +02:00
parent b47c45e218
commit 308878749f
5 changed files with 3 additions and 33 deletions

View file

@ -44,7 +44,6 @@ def test_respond_in_clause_unknown_lang_falls_back_to_english():
assert respond_in_clause("xx") == ""
@pytest.mark.asyncio
async def test_translate_happy_path(monkeypatch):
from unittest.mock import AsyncMock, MagicMock
@ -66,7 +65,6 @@ async def test_translate_happy_path(monkeypatch):
assert llm_log.cost_usd == pytest.approx(0.00002)
@pytest.mark.asyncio
async def test_translate_strips_code_fences(monkeypatch):
"""If the LLM wraps the output in ```markdown ... ```, strip it."""
from unittest.mock import AsyncMock, MagicMock
@ -85,7 +83,6 @@ async def test_translate_strips_code_fences(monkeypatch):
assert translated.startswith("# Titolo")
@pytest.mark.asyncio
async def test_translate_provider_failure_propagates(monkeypatch):
from unittest.mock import AsyncMock, MagicMock
@ -98,7 +95,6 @@ async def test_translate_provider_failure_propagates(monkeypatch):
await mod.translate(client, "# Title\n\nBody.", "it")
@pytest.mark.asyncio
async def test_translate_unknown_lang_returns_source_unchanged(monkeypatch):
"""Defensive: an unknown lang code (or 'en') short-circuits without
calling the LLM. Callers shouldn't have to gate the call themselves."""