From 35aa61c651217663406c9cd6df404f85338b2d68 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 2 Apr 2026 14:17:43 +0900 Subject: style: fix lint and formatting issues across news collector and shared --- shared/tests/test_db_news.py | 2 -- shared/tests/test_sentiment_aggregator.py | 12 ++++++++++-- shared/tests/test_sentiment_models.py | 1 - 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'shared/tests') diff --git a/shared/tests/test_db_news.py b/shared/tests/test_db_news.py index f13cf1e..a2c9140 100644 --- a/shared/tests/test_db_news.py +++ b/shared/tests/test_db_news.py @@ -1,7 +1,5 @@ """Tests for database news/sentiment methods. Uses in-memory SQLite.""" -import json -import uuid import pytest from datetime import datetime, date, timezone diff --git a/shared/tests/test_sentiment_aggregator.py b/shared/tests/test_sentiment_aggregator.py index f9277e7..a99c711 100644 --- a/shared/tests/test_sentiment_aggregator.py +++ b/shared/tests/test_sentiment_aggregator.py @@ -1,4 +1,5 @@ """Tests for sentiment aggregator.""" + import pytest from datetime import datetime, timezone, timedelta from shared.sentiment import SentimentAggregator @@ -35,7 +36,9 @@ def test_freshness_decay_old(): def test_compute_composite(): a = SentimentAggregator() - composite = a._compute_composite(news_score=0.5, social_score=0.3, policy_score=0.8, filing_score=0.2) + composite = a._compute_composite( + news_score=0.5, social_score=0.3, policy_score=0.8, filing_score=0.2 + ) expected = 0.5 * 0.3 + 0.3 * 0.2 + 0.8 * 0.3 + 0.2 * 0.2 assert abs(composite - expected) < 0.001 @@ -44,7 +47,12 @@ def test_aggregate_news_by_symbol(aggregator): now = datetime.now(timezone.utc) news_items = [ {"symbols": ["AAPL"], "sentiment": 0.8, "category": "earnings", "published_at": now}, - {"symbols": ["AAPL"], "sentiment": 0.3, "category": "macro", "published_at": now - timedelta(hours=2)}, + { + "symbols": ["AAPL"], + "sentiment": 0.3, + "category": "macro", + "published_at": now - timedelta(hours=2), + }, {"symbols": ["MSFT"], "sentiment": -0.5, "category": "policy", "published_at": now}, ] scores = aggregator.aggregate(news_items, now) diff --git a/shared/tests/test_sentiment_models.py b/shared/tests/test_sentiment_models.py index 74f1acd..25fc371 100644 --- a/shared/tests/test_sentiment_models.py +++ b/shared/tests/test_sentiment_models.py @@ -1,6 +1,5 @@ """Tests for news and sentiment models.""" -import pytest from datetime import datetime, timezone from shared.models import NewsCategory, NewsItem, OrderSide -- cgit v1.2.3