diff --git a/src/allmydata/test/common_util.py b/src/allmydata/test/common_util.py index 9e8149d135..c95f71681f 100644 --- a/src/allmydata/test/common_util.py +++ b/src/allmydata/test/common_util.py @@ -195,6 +195,9 @@ def restoreTimezone(): self.addCleanup(restoreTimezone) tzset_if_possible() + def have_working_tzset(self): + return hasattr(time, 'tzset') + try: import win32file diff --git a/src/allmydata/test/test_util.py b/src/allmydata/test/test_util.py index 25b656156e..be5541e885 100644 --- a/src/allmydata/test/test_util.py +++ b/src/allmydata/test/test_util.py @@ -932,6 +932,10 @@ def test_epoch_in_London(self): # time_format.iso_utc_time_to_localseconds() breaks if the timezone is # Europe/London. (As soon as this unit test is done then I'll change # that implementation to something that works even in this case...) + + if not self.have_working_tzset(): + raise unittest.SkipTest("This test can't be run on a platform without time.tzset().") + self.setTimezone("Europe/London") return self._help_test_epoch() diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index 18514a3a57..2a968f9aed 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -634,10 +634,25 @@ def _check(res): self.failUnlessIn(u'