From: R. David Murray Date: Tue, 14 Dec 2010 01:22:50 +0000 (+0000) Subject: Use skipIf instead of a return when attribute doesn't exist. X-Git-Tag: v3.2b2~107 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ecf76ea3617dc32ce7fcba732e2ee9fb48b1e30;p=thirdparty%2FPython%2Fcpython.git Use skipIf instead of a return when attribute doesn't exist. --- diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index eaa4e83e24c3..600d476790ad 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -126,9 +126,9 @@ class TimeTestCase(unittest.TestCase): def test_asctime_bounding_check(self): self._bounds_checking(time.asctime) + @unittest.skipIf(not hasattr(time, "tzset"), + "time module has no attribute tzset") def test_tzset(self): - if not hasattr(time, "tzset"): - return # Can't test this; don't want the test suite to fail from os import environ