@@ -724,14 +724,13 @@ async def test_convert_time_anchors_to_today_in_the_source_timezone() -> None:
724724 assert result ["target" ]["datetime" ] == "2024-01-02T00:00:00+00:00"
725725
726726
727- # KNOWN BUG #5002: a nonexistent (spring-forward) local time is converted as if valid, with no warning; the fix changes this assertion.
728727async def test_convert_time_into_a_nonexistent_local_time () -> None :
729728 # 02:30 on 2024-03-10 does not exist in New York (clocks jump 02:00 ->
730- # 03:00). With fold=0 zoneinfo uses the pre-transition offset (EST), so
731- # the server reports a wall-clock time that never happened, unflagged .
729+ # 03:00), so the conversion is rejected rather than reporting a
730+ # wall-clock time that never happened (#5002) .
732731 async with connected () as session :
733732 with frozen_at ("2024-03-10 12:00:00+00:00" ):
734- result = await call_json (
733+ result = await call (
735734 session ,
736735 "convert_time" ,
737736 {
@@ -740,21 +739,10 @@ async def test_convert_time_into_a_nonexistent_local_time() -> None:
740739 "target_timezone" : "UTC" ,
741740 },
742741 )
743- assert result == {
744- "source" : {
745- "timezone" : "America/New_York" ,
746- "datetime" : "2024-03-10T02:30:00-05:00" ,
747- "day_of_week" : "Sunday" ,
748- "is_dst" : False ,
749- },
750- "target" : {
751- "timezone" : "UTC" ,
752- "datetime" : "2024-03-10T07:30:00+00:00" ,
753- "day_of_week" : "Sunday" ,
754- "is_dst" : False ,
755- },
756- "time_difference" : "+5.0h" ,
757- }
742+ assert result == handler_error (
743+ "Invalid time: 02:30 does not exist in America/New_York on 2024-03-10 "
744+ "(skipped by a clock change)"
745+ )
758746
759747
760748async def test_convert_time_at_an_ambiguous_local_time () -> None :
0 commit comments