Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
import zoneinfo
except ImportError:
from backports import zoneinfo
from dateutil.zoneinfo import get_zonefile_instance


def make_full_tz_list():
dateutil_zones = set(get_zonefile_instance().zones)
zoneinfo_zones = set(zoneinfo.available_timezones())
# Since the tests create ZoneInfo objects, we can only use timezones

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you would prefer that I remove this comment, it's mostly not relevant now that there's no other option to contrast it with.

# that are available in zoneinfo. Filter out any dateutil-only timezones
# that are not available in zoneinfo (like Asia/Hanoi which was renamed to Asia/Ho_Chi_Minh)
all_zones = dateutil_zones.union(zoneinfo_zones)
return {tz for tz in all_zones if tz in zoneinfo_zones}
# that are available in zoneinfo.
return zoneinfo.available_timezones()


def assert_datetime_equality(dt1, dt2, within=10):
Expand Down
Loading