Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6ecf76e

Browse files
committed
Use skipIf instead of a return when attribute doesn't exist.
1 parent 4d55bf9 commit 6ecf76e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/test/test_time.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ def test_asctime(self):
126126
def test_asctime_bounding_check(self):
127127
self._bounds_checking(time.asctime)
128128

129+
@unittest.skipIf(not hasattr(time, "tzset"),
130+
"time module has no attribute tzset")
129131
def test_tzset(self):
130-
if not hasattr(time, "tzset"):
131-
return # Can't test this; don't want the test suite to fail
132132

133133
from os import environ
134134

0 commit comments

Comments
 (0)