diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-02 14:17:43 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-04-02 14:17:43 +0900 |
| commit | 35aa61c651217663406c9cd6df404f85338b2d68 (patch) | |
| tree | 9d85dd87e725984d45d7b6bdfef8b316ddfc4ae7 /shared/tests | |
| parent | 17540c99d5e28576a6642e23d7bd6b297513e2d8 (diff) | |
style: fix lint and formatting issues across news collector and shared
Diffstat (limited to 'shared/tests')
| -rw-r--r-- | shared/tests/test_db_news.py | 2 | ||||
| -rw-r--r-- | shared/tests/test_sentiment_aggregator.py | 12 | ||||
| -rw-r--r-- | shared/tests/test_sentiment_models.py | 1 |
3 files changed, 10 insertions, 5 deletions
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 |
