From 3162cff96b1607ad9e64e22b91c1bc1e26f01409 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 3 Jun 2026 15:45:59 -0400 Subject: [PATCH] fix(artist): ruff UP017 + test_directory_card_shape pin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two CI bounces on b65e956: 1. ruff UP017 — Python 3.14's preferred form is `datetime.UTC`, not `timezone.utc`. Switch the test's two TZ literals. 2. test_directory_card_shape pinned the card key set to the pre-feature shape; `unseen_count` was added to the API payload but the pin wasn't updated. Same shape as the recurring 'plan-grep-pinned-tests' trap — should have grepped tests/ for card.keys() before pushing. --- tests/test_api_artists_directory.py | 3 ++- tests/test_artist_visit.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_api_artists_directory.py b/tests/test_api_artists_directory.py index 64b3dda..1df5863 100644 --- a/tests/test_api_artists_directory.py +++ b/tests/test_api_artists_directory.py @@ -43,7 +43,8 @@ async def test_directory_card_shape(client, seeded): body = await resp.get_json() card = next(c for c in body["cards"] if c["name"] == "alice-api") assert set(card.keys()) == { - "id", "name", "slug", "is_subscription", "image_count", "preview_thumbnails", + "id", "name", "slug", "is_subscription", "image_count", + "unseen_count", "preview_thumbnails", } assert card["is_subscription"] is True assert card["image_count"] == 1 diff --git a/tests/test_artist_visit.py b/tests/test_artist_visit.py index 7236d33..b080e33 100644 --- a/tests/test_artist_visit.py +++ b/tests/test_artist_visit.py @@ -11,7 +11,7 @@ Covers: last_viewed_at = NOW()) """ -from datetime import datetime, timedelta, timezone +from datetime import UTC, datetime, timedelta import pytest from sqlalchemy import select @@ -23,8 +23,8 @@ from backend.app.services.artist_service import ArtistService pytestmark = pytest.mark.integration -_LONG_AGO = datetime(2000, 1, 1, tzinfo=timezone.utc) -_RECENTLY = datetime(2099, 1, 1, tzinfo=timezone.utc) +_LONG_AGO = datetime(2000, 1, 1, tzinfo=UTC) +_RECENTLY = datetime(2099, 1, 1, tzinfo=UTC) async def _seed_artist(db, name: str) -> Artist: