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

Function add_tzstr_tests

tests/test_tzfile.py:1107–1119  ·  view source on GitHub ↗
(tzstr, test_cases, varying=True)

Source from the content-addressed store, hash-verified

1105 GAP = 2
1106
1107 def add_tzstr_tests(tzstr, test_cases, varying=True):
1108 zi = zone_from_tzstr(tzstr)
1109 if varying:
1110 cases["varying_zones"].append((zi,))
1111
1112 for dt_naive, offset, dt_type in test_cases:
1113 dt = dt_naive.replace(tzinfo=zi)
1114 cases["offset"].append((dt, offset))
1115 if dt_type == GAP:
1116 continue
1117
1118 dt_utc = (dt_naive - offset.utcoffset).replace(tzinfo=tz.UTC)
1119 cases["utc"].append((dt, dt_utc))
1120
1121 @add_cases
1122 def _tzstr_standard_est5edt():

Calls 3

zone_from_tzstrFunction · 0.85
appendMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected