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:
parent
b47c45e218
commit
308878749f
5 changed files with 3 additions and 33 deletions
|
|
@ -30,7 +30,6 @@ def _build_session_factory(tmp_path):
|
|||
return engine, factory, _setup
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_validate_happy_path(tmp_path, monkeypatch):
|
||||
from app.routers.ticker_validate import validate_ticker
|
||||
from app.services.market import Quote
|
||||
|
|
@ -62,7 +61,6 @@ async def test_validate_happy_path(tmp_path, monkeypatch):
|
|||
assert result["as_of"] == "2026-05-27"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_validate_unknown_symbol(tmp_path, monkeypatch):
|
||||
from app.routers.ticker_validate import validate_ticker
|
||||
from app.services.market import Quote
|
||||
|
|
@ -85,7 +83,6 @@ async def test_validate_unknown_symbol(tmp_path, monkeypatch):
|
|||
assert "not recognised" in result["error"].lower()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_validate_empty_symbol_rejects():
|
||||
from app.routers.ticker_validate import validate_ticker
|
||||
|
||||
|
|
@ -95,7 +92,6 @@ async def test_validate_empty_symbol_rejects():
|
|||
assert "required" in result["error"].lower()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_validate_seeds_universe_and_quote(tmp_path, monkeypatch):
|
||||
"""Side-effect check: on success, the symbol is upserted into the
|
||||
universe and a Quote row is written."""
|
||||
|
|
@ -137,7 +133,6 @@ async def test_validate_seeds_universe_and_quote(tmp_path, monkeypatch):
|
|||
assert rows[0].currency == "USD"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_historical_happy_path(monkeypatch):
|
||||
from app.routers.ticker_validate import get_historical
|
||||
import app.routers.ticker_validate as mod
|
||||
|
|
@ -156,7 +151,6 @@ async def test_historical_happy_path(monkeypatch):
|
|||
assert result["actual_date"] == "2024-01-12"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_historical_future_date_rejected():
|
||||
from fastapi import HTTPException
|
||||
from app.routers.ticker_validate import get_historical
|
||||
|
|
@ -168,7 +162,6 @@ async def test_historical_future_date_rejected():
|
|||
assert "future" in str(exc.value.detail).lower()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_historical_bad_date_format_rejected():
|
||||
from fastapi import HTTPException
|
||||
from app.routers.ticker_validate import get_historical
|
||||
|
|
@ -178,7 +171,6 @@ async def test_historical_bad_date_format_rejected():
|
|||
assert exc.value.status_code == 400
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_historical_no_data(monkeypatch):
|
||||
from app.routers.ticker_validate import get_historical
|
||||
import app.routers.ticker_validate as mod
|
||||
|
|
@ -192,7 +184,6 @@ async def test_historical_no_data(monkeypatch):
|
|||
assert "no data" in result["error"].lower()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_historical_provider_failure(monkeypatch):
|
||||
import httpx
|
||||
|
||||
|
|
@ -208,7 +199,6 @@ async def test_historical_provider_failure(monkeypatch):
|
|||
assert "couldn" in result["error"].lower() or "fetch" in result["error"].lower()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_fetch_yahoo_historical_walks_back_to_preceding_trading_day(monkeypatch):
|
||||
"""Unit test for the helper itself: feed a hand-crafted series with a
|
||||
weekend gap, ask for the Saturday close, expect Friday's close."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue