From 940e967d5e8a7f49b9090c90a681bac0c6fd4ffa Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 11:49:24 +0000 Subject: [PATCH 1/2] Freeze the clock in the conference archiving regression tests TestConferenceArchiving built its fixtures from the real clock with date spans of a few days to a few weeks. On some days of the year those spans straddle New Year and the schema rejects them as multi-year conferences: the boundary test failed from 30 December into 1 January, and the past, future, extended-deadline and timezone tests have their own windows in November, January and February. An autouse fixture now pins the clock mid-year for the whole class. With the clock fixed, the boundary test asserts the actual behaviour instead of only checking for a bool: a deadline one hour ago is still open in AoE and has passed in UTC. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016a2XGjJgh5Shvhnbc1LL3t --- tests/regression/test_conference_archiving.py | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/tests/regression/test_conference_archiving.py b/tests/regression/test_conference_archiving.py index 0269782e8b8..0de7ee4a7a2 100644 --- a/tests/regression/test_conference_archiving.py +++ b/tests/regression/test_conference_archiving.py @@ -11,6 +11,7 @@ import pytest import yaml +from freezegun import freeze_time # Add utils to path for imports sys.path.append(str(Path(__file__).parent.parent.parent / "utils")) @@ -21,9 +22,21 @@ from tidy_conf.schema import Conference +# The fixtures and tests below build dates relative to "now" with spans of a +# few days to a few weeks. Unfrozen, those spans straddle New Year on some +# days of the year and the schema rejects them as multi-year conferences. +FROZEN_NOW = "2026-06-15 12:00:00" + + class TestConferenceArchiving: """Test automatic conference archiving logic.""" + @pytest.fixture(autouse=True) + def _frozen_clock(self): + """Pin the clock mid-year so relative dates never cross a year boundary.""" + with freeze_time(FROZEN_NOW): + yield + @pytest.fixture() def past_conference(self): """Create a conference that should be archived.""" @@ -81,14 +94,13 @@ def test_identify_past_conferences(self, past_conference, future_conference): assert sort_yaml.sort_by_date_passed(future_conf) is False def test_archive_boundary_conditions(self, edge_case_conference): - """Test archiving behavior at boundary conditions.""" - edge_conf = Conference(**edge_case_conference) - - # Conference with CFP 1 hour ago - result depends on exact timing - # since sort_by_date_passed compares CFP datetime (not just date) - is_passed = sort_yaml.sort_by_date_passed(edge_conf) - # Just verify it returns a boolean - the exact result depends on timing - assert isinstance(is_passed, bool) + """A deadline one hour ago is open in AoE and passed in UTC.""" + # Without a timezone the deadline is AoE (UTC-12), so "one hour ago" + # in UTC wall time is still eleven hours away. + assert sort_yaml.sort_by_date_passed(Conference(**edge_case_conference)) is False + + utc_conf = Conference(**{**edge_case_conference, "timezone": "UTC"}) + assert sort_yaml.sort_by_date_passed(utc_conf) is True def test_archive_with_extended_deadline(self): """Test that extended deadlines are handled during archiving. From b2e9032a26a1a896982ecbb2eb0a3411cd837828 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Nov 2026 11:50:00 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/regression/test_conference_archiving.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/regression/test_conference_archiving.py b/tests/regression/test_conference_archiving.py index 0de7ee4a7a2..aeeb276c52e 100644 --- a/tests/regression/test_conference_archiving.py +++ b/tests/regression/test_conference_archiving.py @@ -21,7 +21,6 @@ import sort_yaml from tidy_conf.schema import Conference - # The fixtures and tests below build dates relative to "now" with spans of a # few days to a few weeks. Unfrozen, those spans straddle New Year on some # days of the year and the schema rejects them as multi-year conferences.