]> granicus.if.org Git - python/commitdiff
Use skipIf instead of a return when attribute doesn't exist.
authorR. David Murray <rdmurray@bitdance.com>
Tue, 14 Dec 2010 01:22:50 +0000 (01:22 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Tue, 14 Dec 2010 01:22:50 +0000 (01:22 +0000)
Lib/test/test_time.py

index eaa4e83e24c3f2defd1fc0231d3ddbd4bc92ec3c..600d476790ad7d308b9f8d51aadf24630bb27973 100644 (file)
@@ -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