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