Merge fix from Yonggang Luo for skipping test that requires tzset on Windows.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 11 Mar 2012 03:45:45 +0000 (04:45 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 11 Mar 2012 03:45:45 +0000 (04:45 +0100)
1  2 
subvertpy/tests/test_properties.py

  import os
  import time
  from subvertpy import properties
--from subvertpy.tests import TestCase
++from subvertpy.tests import (
++    SkipTest,
++    TestCase,
++    )
  
  class TestProperties(TestCase):
  
  
      def test_time_from_cstring_independent_from_dst(self):
          old_tz = os.environ.get('TZ', None)
 -        if not hasattr(time, 'tzset'):
 -            return
+         # On Windows, there is no tzset function, so skip this test.
++        if getattr(time, 'tzset', None) is None:
++            raise SkipTest("tzset not available on Windows")
          try:
              # First specify a fixed timezone with known DST (late March to late October)
              os.environ['TZ'] = 'Europe/London'