summaryrefslogtreecommitdiff
path: root/shared/tests/test_db_news.py
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-02 15:54:55 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-02 15:54:55 +0900
commitbf4afbc0a3cc4e847ef01840365fd6a6ae9c142f (patch)
treec8634b3b21534f550e2d255d98c4a068a1b567d0 /shared/tests/test_db_news.py
parentec8b6fea5a4a710df4b2ae18f3f399d165c8ffd4 (diff)
style: auto-fix lint violations from enhanced ruff rules
Diffstat (limited to 'shared/tests/test_db_news.py')
-rw-r--r--shared/tests/test_db_news.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/shared/tests/test_db_news.py b/shared/tests/test_db_news.py
index a2c9140..c184bed 100644
--- a/shared/tests/test_db_news.py
+++ b/shared/tests/test_db_news.py
@@ -1,11 +1,12 @@
"""Tests for database news/sentiment methods. Uses in-memory SQLite."""
+from datetime import UTC, date, datetime
+
import pytest
-from datetime import datetime, date, timezone
from shared.db import Database
-from shared.models import NewsItem, NewsCategory
-from shared.sentiment_models import SymbolScore, MarketSentiment
+from shared.models import NewsCategory, NewsItem
+from shared.sentiment_models import MarketSentiment, SymbolScore
@pytest.fixture
@@ -20,7 +21,7 @@ async def test_insert_and_get_news_items(db):
item = NewsItem(
source="finnhub",
headline="AAPL earnings beat",
- published_at=datetime(2026, 4, 2, 12, 0, tzinfo=timezone.utc),
+ published_at=datetime(2026, 4, 2, 12, 0, tzinfo=UTC),
sentiment=0.8,
category=NewsCategory.EARNINGS,
symbols=["AAPL"],
@@ -40,7 +41,7 @@ async def test_upsert_symbol_score(db):
policy_score=0.0,
filing_score=0.2,
composite=0.3,
- updated_at=datetime(2026, 4, 2, tzinfo=timezone.utc),
+ updated_at=datetime(2026, 4, 2, tzinfo=UTC),
)
await db.upsert_symbol_score(score)
scores = await db.get_top_symbol_scores(limit=5)
@@ -55,7 +56,7 @@ async def test_upsert_market_sentiment(db):
vix=18.2,
fed_stance="neutral",
market_regime="neutral",
- updated_at=datetime(2026, 4, 2, tzinfo=timezone.utc),
+ updated_at=datetime(2026, 4, 2, tzinfo=UTC),
)
await db.upsert_market_sentiment(ms)
result = await db.get_latest_market_sentiment()