MCPcopy Create free account
hub / github.com/dateutil/dateutil / test_utc_round_trip

Function test_utc_round_trip

tests/test_tzpath_data.py:88–94  ·  view source on GitHub ↗

Converting from UTC to local time and back gives the same instant.

(tz_source)

Source from the content-addressed store, hash-verified

86
87
88def test_utc_round_trip(tz_source):
89 """Converting from UTC to local time and back gives the same instant."""
90 for key in _keys():
91 zone = tz.gettz(key)
92 for dt_utc in _probe_instants(zone):
93 dt = dt_utc.astimezone(zone)
94 assert dt.astimezone(UTC) == dt_utc, (key, dt_utc, dt)
95
96
97def test_ambiguous_and_imaginary(tz_source):

Callers

nothing calls this directly

Calls 3

_keysFunction · 0.85
_probe_instantsFunction · 0.85
gettzMethod · 0.45

Tested by

no test coverage detected