From afd4fa55c69015a6da1ebb306a897193d7714324 Mon Sep 17 00:00:00 2001 From: safishamsi Date: Mon, 12 Oct 2026 13:01:40 +0100 Subject: [PATCH] test(prs): use a now-relative date so the PR-dict test can't go STALE The #3829 fixture hardcoded updatedAt, which crosses the 14-day staleness window over time and flips the asserted status from APPROVED to STALE. Compute a recent date instead. Co-Authored-By: Claude Opus 4.8 --- tests/test_prs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_prs.py b/tests/test_prs.py index 93e69a404..632455bea 100644 --- a/tests/test_prs.py +++ b/tests/test_prs.py @@ -530,6 +530,9 @@ class TestSubprocessStdinIsolation: class TestParsePrDict: def test_parse_pr_dict_complete(self): + # A recent updatedAt so status stays APPROVED (a hardcoded date eventually + # crosses the staleness window and _classify returns STALE first). + recent = datetime.now(timezone.utc) - timedelta(days=1) raw = { "number": 42, "title": "Add feature", @@ -539,7 +542,7 @@ class TestParsePrDict: "isDraft": False, "reviewDecision": "APPROVED", "statusCheckRollup": [{"conclusion": "SUCCESS", "status": "COMPLETED"}], - "updatedAt": "2026-09-20T10:00:00Z", + "updatedAt": recent.strftime("%Y-%m-%dT%H:%M:%SZ"), } pr = _parse_pr_dict(raw, expected_base="v8") assert pr.number == 42 @@ -551,7 +554,7 @@ class TestParsePrDict: assert pr.review_decision == "APPROVED" assert pr.ci_status == "SUCCESS" assert pr.status == "APPROVED" - assert pr.updated_at.year == 2026 + assert pr.updated_at.year == recent.year def test_parse_pr_dict_defaults_on_missing_optional_fields(self): raw = {