(self)
| 206 | gval=cls._guard_allows_change) |
| 207 | |
| 208 | def __enter__(self): |
| 209 | if not self.tz_change_allowed(): |
| 210 | msg = self.tz_change_disallowed_message() |
| 211 | pytest.skip(msg) |
| 212 | |
| 213 | # If this is used outside of a test suite, we still want an error. |
| 214 | raise ValueError(msg) # pragma: no cover |
| 215 | |
| 216 | self._old_tz = self.get_current_tz() |
| 217 | self.set_current_tz(self.tzval) |
| 218 | |
| 219 | def __exit__(self, type, value, traceback): |
| 220 | if self._old_tz is not None: |
no test coverage detected