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

Method __enter__

tests/_common.py:88–97  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

86 gval=cls._guard_allows_change)
87
88 def __enter__(self):
89 if not self.tz_change_allowed():
90 msg = self.tz_change_disallowed_message()
91 pytest.skip(msg)
92
93 # If this is used outside of a test suite, we still want an error.
94 raise ValueError(msg) # pragma: no cover
95
96 self._old_tz = self.get_current_tz()
97 self.set_current_tz(self.tzval)
98
99 def __exit__(self, type, value, traceback):
100 if self._old_tz is not None:

Callers

nothing calls this directly

Calls 4

tz_change_allowedMethod · 0.95
get_current_tzMethod · 0.95
set_current_tzMethod · 0.95

Tested by

no test coverage detected