allenporter/ical

Test regressed with tzdata-2022g

vcunat opened this issue · 1 comments

At a quick glance, it bails on a time-zone that doesn't exist yet (but soon will).

=================================== FAILURES ===================================
___________________ test_all_zoneinfo[America/Ciudad_Juarez] ___________________
key = 'America/Ciudad_Juarez'
    @pytest.mark.parametrize("key", zoneinfo.available_timezones())
    def test_all_zoneinfo(key: str) -> None:
        """Verify that all available timezones in the system have valid tzdata."""
        if key.startswith("System") or key == "localtime":
            return
>       result = timezoneinfo.read(key)
tests/tzif/test_timezoneinfo.py:141:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
key = 'America/Ciudad_Juarez'
    def read(key: str) -> TimezoneInfo:
        """Read the TZif file from the tzdata package and return timezone records."""
        if key not in _read_system_timezones() or key not in _read_tzdata_timezones():
>           raise TimezoneInfoError(f"Unable to find timezone in system timezones: {key}")
E           ical.tzif.timezoneinfo.TimezoneInfoError: Unable to find timezone in system timezones: America/Ciudad_Juarez
ical/tzif/timezoneinfo.py:69: TimezoneInfoError
=========================== short test summary info ============================
FAILED tests/tzif/test_timezoneinfo.py::test_all_zoneinfo[America/Ciudad_Juarez]
================== 1 failed, 897 passed, 20 skipped in 3.86s ===================

https://mm.icann.org/pipermail/tz-announce/2022-November/000076.html

Changes to future timestamps

In the Mexican state of Chihuahua, the border strip near the US
will change to agree with nearby US locations on 2022-11-30.
The strip's western part, represented by Ciudad Juárez, switches
from -06 all year to -07/-06 with US DST rules, like El Paso, TX.
The eastern part, represented by Ojinaga, will observe US DST next
year, like Presidio, TX. (Thanks to Heitor David Pinto.)
A new Zone America/Ciudad_Juarez splits from America/Ojinaga.

Thanks for the report. I think this check may be incorrect:

    if key not in _read_system_timezones() or key not in _read_tzdata_timezones():
        raise TimezoneInfoError(f"Unable to find timezone in system timezones: {key}")

I think reading this, we want to be sure the timezone exists in either, but it doesn't necessarily need to exist in both.

It seems like really the requirement we have is: If any python system timezone is found, then we want to make sure we have tzdata for it. I think we don't care if there are new tzdata timezones that aren't found in the system timezone.