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

Function tz_source_context

tests/_common.py:97–102  ·  view source on GitHub ↗

A context manager that makes ``source`` the only time zone data.

(source)

Source from the content-addressed store, hash-verified

95
96
97def tz_source_context(source):
98 """A context manager that makes ``source`` the only time zone data."""
99 if source == "tzpath":
100 return set_tzpath(tuple(tz.TZPATH), block_tzdata=True)
101 else:
102 return set_tzpath((), block_tzdata=False)
103
104
105class TzSourceMixin:

Callers 3

test_gettz_returns_localFunction · 0.90
setUpMethod · 0.85
tz_sourceFunction · 0.85

Calls 1

set_tzpathFunction · 0.85

Tested by 2

test_gettz_returns_localFunction · 0.72
tz_sourceFunction · 0.68