(self)
| 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: |
nothing calls this directly
no test coverage detected