Normalize persisted test timestamps
Deploy / lint (push) Successful in 9s
Deploy / test (push) Successful in 1m12s
Deploy / deploy (push) Successful in 37s

This commit is contained in:
2026-07-03 13:01:45 +02:00
parent 8c36cfcef1
commit d4ccea2d69
+7 -3
View File
@@ -30,6 +30,10 @@ from app.models.sentiment import SentimentScore
from app.services.rr_scanner_service import scan_ticker, get_trade_setups from app.services.rr_scanner_service import scan_ticker, get_trade_setups
def _as_utc(value: datetime) -> datetime:
return value if value.tzinfo is not None else value.replace(tzinfo=timezone.utc)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Session fixtures # Session fixtures
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@@ -753,10 +757,10 @@ async def test_live_overlay_preserves_setup_specific_risk_and_context(
"target-availability: Fewer than 3 valid S/R targets available" "target-availability: Fewer than 3 valid S/R targets available"
] ]
assert row["current_price"] == pytest.approx(101.0) assert row["current_price"] == pytest.approx(101.0)
assert row["context_as_of"]["score_computed_at"] == current assert _as_utc(row["context_as_of"]["score_computed_at"]) == current
assert row["context_as_of"]["sentiment_at"] == current assert _as_utc(row["context_as_of"]["sentiment_at"]) == current
assert row["context_as_of"]["price_date"] == date(2026, 7, 3) assert row["context_as_of"]["price_date"] == date(2026, 7, 3)
assert row["context_as_of"]["price_updated_at"] == current assert _as_utc(row["context_as_of"]["price_updated_at"]) == current
@pytest.mark.asyncio @pytest.mark.asyncio